TFile.Copy

From Soldat Community Wiki
Revision as of 17:15, 26 July 2013 by Falcon (talk | contribs) (Created page with " '''''function Copy(const Source, Destination: string): Boolean''''' Source: a path to a file to copy Destination: a path to a file that should be created Result: Whenev...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
function Copy(const Source, Destination: string): Boolean
 Source: a path to a file to copy
 Destination: a path to a file that should be created
 Result: Whenever copy operation was successful or not

Description

This function checks whenever file pointed by Source exists on hard drive. If the path is out of script's sandbox, EAccessViolation exception is thrown.

Example

begin
  try
    File.Copy('soldat.ini', 'soldat.ini.bak');
  except
    WriteLn('access to soldat.ini denied');
  end;
end;