filutilh.inc 2.9 KB

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