Posted By

icebob on 08/02/10


Tagged


Versions (?)

Creates a temporal file and returns its path name


 / Published in: Delphi
 

  1. function GetTempFile: TFileName;
  2. // Creates a temporal file and returns its path name
  3. var
  4. TempFileName: array [0..MAX_PATH-1] of char;
  5. begin
  6. if GetTempFileName(PChar(GetTempDirectory), '~', 0, TempFileName) = 0 then
  7. raise Exception.Create(SysErrorMessage(GetLastError));
  8. Result := TempFileName;
  9. end;

Report this snippet  

You need to login to post a comment.