osutilsh.inc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt
  5. member of the Free Pascal development team
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. { OS handling utilities }
  13. {$ifdef HAS_OSERROR}
  14. Function GetLastOSError : Integer;
  15. {$endif}
  16. Procedure RaiseLastOSError;
  17. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  18. Function GetEnvironmentVariableCount : Integer;
  19. Function GetEnvironmentString(Index : Integer) : String;
  20. {$IFDEF HAS_SLEEP}
  21. procedure Sleep(milliseconds: Cardinal);
  22. {$ENDIF}
  23. function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integer;
  24. function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString):integer;
  25. Function GetTempDir(Global : Boolean) : String;
  26. Function GetTempDir : String;
  27. Function GetTempFileName(Const Dir,Prefix : String) : String;
  28. Function GetTempFileName : String;
  29. Function GetAppConfigDir(Global : Boolean) : String;
  30. Function GetAppConfigFile(Global : Boolean) : String;
  31. Function GetAppConfigFile(Global : Boolean; SubDir : Boolean) : String;
  32. Function ApplicationName : String;
  33. Const
  34. ConfigExtension : String = '.cfg';
  35. SysConfigDir : String = '';
  36. Type
  37. TGetAppNameEvent = Function : String;
  38. TGetTempDirEvent = Function (Global : Boolean) : String;
  39. TGetTempFileEvent = Function (Const Dir,Prefix : String) : String;
  40. Var
  41. OnGetApplicationName : TGetAppNameEvent;
  42. OnGetTempDir : TGetTempDirEvent;
  43. OnGetTempFile : TGetTempFileEvent;
  44. {
  45. $Log$
  46. Revision 1.10 2005-02-14 17:13:31 peter
  47. * truncate log
  48. }