Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Backup from an open file

Posted on 1998-03-28
5
Medium Priority
?
216 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

971 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