Creates a temporal file and returns its path name


/ Published in: Delphi
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.