filutilh.inc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1998 by the Free Pascal development team
  5. File utility calls
  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. {$ifndef win32}
  13. Type
  14. THandle = Longint; // Needed for TSearchRec
  15. {$endif}
  16. Type
  17. TSearchRec = Record
  18. Time,Size, Attr : Longint;
  19. Name : TFileName;
  20. ExcludeAttr : Longint;
  21. FindHandle : THandle;
  22. {$ifdef Win32}
  23. FindData : TWin32FindData;
  24. {$endif}
  25. end;
  26. Const
  27. faReadOnly = $00000001;
  28. faHidden = $00000002;
  29. faSysFile = $00000004;
  30. faVolumeId = $00000008;
  31. faDirectory = $00000010;
  32. faArchive = $00000020;
  33. faAnyFile = $0000003f;
  34. Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
  35. Function FileCreate (Const FileName : String) : Longint;
  36. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  37. Function FileWrite (Handle : Longint; Var Buffer; Count : Longint) : Longint;
  38. Function FileSeek (Handle,Offset,Origin : Longint) : Longint;
  39. Procedure FileClose (Handle : Longint);
  40. Function FileAge (Const FileName : String): Longint;
  41. Function FileExists (Const FileName : String) : Boolean;
  42. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  43. Function FindNext (Var Rslt : TSearchRec) : Longint;
  44. Procedure FindClose (Var F : TSearchrec);
  45. Function FileGetDate (Handle : Longint) : Longint;
  46. Function FileSetDate (Handle,Age : Longint) : Longint;
  47. Function FileGetAttr (Const FileName : String) : Longint;
  48. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  49. Function DeleteFile (Const FileName : String) : Boolean;
  50. Function RenameFile (Const OldName, NewName : String) : Boolean;
  51. Function FileSearch (Const Name, DirList : String) : String;
  52. {
  53. $Log$
  54. Revision 1.1 1998-10-11 12:21:01 michael
  55. Added file calls. Implemented for linux only
  56. }