Solved

Backup from an open file

Posted on 1998-03-28
5
202 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 10 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now