filutilh.inc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 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. {$ifdef netware}
  24. FindData : TNetwareFindData;
  25. {$endif}
  26. end;
  27. Const
  28. { File attributes }
  29. faReadOnly = $00000001;
  30. faHidden = $00000002;
  31. faSysFile = $00000004;
  32. faVolumeId = $00000008;
  33. faDirectory = $00000010;
  34. faArchive = $00000020;
  35. faAnyFile = $0000003f;
  36. { File open modes }
  37. fmOpenRead = $0000;
  38. fmOpenWrite = $0001;
  39. fmOpenReadWrite = $0002;
  40. { Share modes}
  41. fmShareCompat = $0000;
  42. fmShareExclusive = $0010;
  43. fmShareDenyWrite = $0020;
  44. fmShareDenyRead = $0030;
  45. fmShareDenyNone = $0040;
  46. { File seek origins }
  47. fsFromBeginning = 0;
  48. fsFromCurrent = 1;
  49. fsFromEnd = 2;
  50. Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
  51. Function FileCreate (Const FileName : String) : Longint;
  52. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  53. Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
  54. Function FileSeek (Handle,FOffset,Origin : Longint) : Longint;
  55. Procedure FileClose (Handle : Longint);
  56. Function FileTruncate (Handle,Size: Longint) : boolean;
  57. Function FileAge (Const FileName : String): Longint;
  58. Function FileExists (Const FileName : String) : Boolean;
  59. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  60. Function FindNext (Var Rslt : TSearchRec) : Longint;
  61. Procedure FindClose (Var F : TSearchrec);
  62. Function FileGetDate (Handle : Longint) : Longint;
  63. Function FileSetDate (Handle,Age : Longint) : Longint;
  64. Function FileGetAttr (Const FileName : String) : Longint;
  65. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  66. Function DeleteFile (Const FileName : String) : Boolean;
  67. Function RenameFile (Const OldName, NewName : String) : Boolean;
  68. Function FileSearch (Const Name, DirList : String) : String;
  69. {
  70. $Log$
  71. Revision 1.4 2001-04-16 18:34:46 florian
  72. * updates from Armin commited
  73. Revision 1.3 2001/01/18 22:09:09 michael
  74. + Merged fixes from fixbranch - file modes
  75. Revision 1.2 2000/07/13 11:33:51 michael
  76. + removed logs
  77. }