filutilh.inc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. TSearchRec = Record
  14. Time : Longint;
  15. Size : Int64;
  16. 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 FileCreate (Const FileName : String; Mode : Integer) : Longint;
  53. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  54. Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
  55. Function FileSeek (Handle,FOffset,Origin : Longint) : Longint;
  56. Function FileSeek (Handle : Longint; FOffset,Origin : Int64) : Int64;
  57. Procedure FileClose (Handle : Longint);
  58. Function FileTruncate (Handle,Size: Longint) : boolean;
  59. Function FileAge (Const FileName : String): Longint;
  60. Function FileExists (Const FileName : String) : Boolean;
  61. Function DirectoryExists (Const Directory : 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.10 2003-04-01 15:57:41 peter
  75. * made THandle platform dependent and unique type
  76. Revision 1.9 2003/03/29 18:21:41 hajny
  77. * DirectoryExists declaration changed to that one from fixes branch
  78. Revision 1.8 2003/03/28 19:06:59 peter
  79. * directoryexists added
  80. Revision 1.7 2003/01/03 20:41:04 peter
  81. * FileCreate(string,mode) overload added
  82. Revision 1.6 2002/09/07 16:01:22 peter
  83. * old logs removed and tabs fixed
  84. }