Solved

Backup from an open file

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Firemonkey Need Sample for Online Shopping Example. 2 142
JAudiorecorder record freezing the app 29 67
update joined tables 2 46
Firemonkey allowing RTL on android 6 32
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

772 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