osutilsh.inc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. {$IFDEF HAS_SLEEP}
  19. procedure Sleep(milliseconds: Cardinal);
  20. {$ENDIF}
  21. function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integer;
  22. function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString):integer;
  23. Function GetAppConfigDir(Global : Boolean) : String;
  24. Function GetAppConfigFile(Global : Boolean) : String;
  25. Function GetAppConfigFile(Global : Boolean; SubDir : Boolean) : String;
  26. Function ApplicationName : String;
  27. Const
  28. ConfigExtension : String = '.cfg';
  29. SysConfigDir : String = '';
  30. Type
  31. TGetAppNameEvent = Function : String;
  32. Var
  33. OnGetApplicationName : TGetAppNameEvent;
  34. {
  35. $Log$
  36. Revision 1.7 2004-08-05 07:28:01 michael
  37. + Added getappconfigdir calls
  38. Revision 1.6 2004/02/13 13:02:21 marco
  39. * addition of second executeprocess prototype
  40. Revision 1.5 2004/02/08 11:02:40 michael
  41. + Implemented RaiseLastOSError
  42. Revision 1.4 2004/01/10 17:34:36 michael
  43. + Implemented sleep() on Unix.
  44. Revision 1.3 2004/01/05 22:37:24 florian
  45. * changed sysutils.exec to ExecuteProcess
  46. Revision 1.2 2004/01/03 08:55:58 marco
  47. * Exec(ansistring) function
  48. Revision 1.1 2003/10/06 21:01:06 peter
  49. * moved classes unit to rtl
  50. Revision 1.3 2002/09/07 16:01:22 peter
  51. * old logs removed and tabs fixed
  52. }