filutilh.inc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. Type
  13. THandle = Longint;
  14. Type
  15. TSearchRec = Record
  16. Time,Size, Attr : Longint;
  17. Name : TFileName;
  18. ExcludeAttr : Longint;
  19. FindHandle : THandle;
  20. {$ifdef Win32}
  21. FindData : TWin32FindData;
  22. {$endif}
  23. end;
  24. Const
  25. faReadOnly = $00000001;
  26. faHidden = $00000002;
  27. faSysFile = $00000004;
  28. faVolumeId = $00000008;
  29. faDirectory = $00000010;
  30. faArchive = $00000020;
  31. faAnyFile = $0000003f;
  32. fmOpenRead = $0000;
  33. fmOpenWrite = $0001;
  34. fmOpenReadWrite = $0002;
  35. Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
  36. Function FileCreate (Const FileName : String) : Longint;
  37. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  38. Function FileWrite (Handle : Longint; Var Buffer; Count : Longint) : Longint;
  39. Function FileSeek (Handle,Offset,Origin : Longint) : Longint;
  40. Procedure FileClose (Handle : Longint);
  41. Function FileTruncate (Handle,Size: Longint) : boolean;
  42. Function FileAge (Const FileName : String): Longint;
  43. Function FileExists (Const FileName : String) : Boolean;
  44. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  45. Function FindNext (Var Rslt : TSearchRec) : Longint;
  46. Procedure FindClose (Var F : TSearchrec);
  47. Function FileGetDate (Handle : Longint) : Longint;
  48. Function FileSetDate (Handle,Age : Longint) : Longint;
  49. Function FileGetAttr (Const FileName : String) : Longint;
  50. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  51. Function DeleteFile (Const FileName : String) : Boolean;
  52. Function RenameFile (Const OldName, NewName : String) : Boolean;
  53. Function FileSearch (Const Name, DirList : String) : String;
  54. {
  55. $Log$
  56. Revision 1.4 1999-02-09 12:38:43 michael
  57. * Fixed INt() proble. Defined THandle, included Filemode constants
  58. Revision 1.3 1999/02/02 21:21:37 michael
  59. + Added filetruncate
  60. Revision 1.2 1998/10/11 13:47:45 michael
  61. + Added disk functions
  62. Revision 1.1 1998/10/11 12:21:01 michael
  63. Added file calls. Implemented for linux only
  64. }