Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Backup from an open file

Posted on 1998-03-28
5
Medium Priority
?
212 Views
Last Modified: 2010-04-06
How can i made a backup from an open file???

* with a different program

         !!!Thanks for your time!!!

e-mail: scortega@javercol.javeriana.edu.co
0
Comment
Question by:kort77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Expert Comment

by:paulo_psa
ID: 1360995
Hi kort77,

If you used LoadFromFile(filename) to open the file, you can use LoadToFile(filename) to save the file.


Regards...
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1360996
Do you want to back up with a different program or with your own ?

You cannot open files that are open already other than readonly. You can thus copy the open file to a backup directory even if it is open and then do the backup. Most backup packages open the file hard (not read only) and thus gives a "Error opening file" when trying to backup an open file ...

If you have copied everything you can safely back everything up ...
0
 

Author Comment

by:kort77
ID: 1360997
Edited text of question
0
 
LVL 1

Expert Comment

by:mrider
ID: 1360998
has file been opened with your program?

0
 
LVL 5

Accepted Solution

by:
inter earned 30 total points
ID: 1360999
Hi,

The opened fields can be opened for reading using a Mode called COMPATIBILITY mode the following program part shows you how to open and read from such a file:

procedure WriteFileToBackUp(FileName:string;BackSt : TFileStream);
var
  Buffer : array[0.16384] of char;
  Size  : integer;
  St : TFileStream;
begin
  St := TFileStream.Create(FileName,fmOpenRead + fmShareCompat);
  try
    while not St.Eof do
    begin
       Size := St.Read(Buffer, SizeOf(Buffer));
       // Here do what ever you want with buffer
       // But be sure to use only Size bytes of the buffer
       // for example if you have another backupstream
       // BackSt.Write(Buffer, Size);
    end;
  finally
    St.Free;
  end;
end;

Regards,
Igor
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question