filutilh.inc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. end;
  24. Const
  25. { File attributes }
  26. faReadOnly = $00000001;
  27. faHidden = $00000002;
  28. faSysFile = $00000004;
  29. faVolumeId = $00000008;
  30. faDirectory = $00000010;
  31. faArchive = $00000020;
  32. faAnyFile = $0000003f;
  33. { File open modes }
  34. fmOpenRead = $0000;
  35. fmOpenWrite = $0001;
  36. fmOpenReadWrite = $0002;
  37. { File seek origins }
  38. fsFromBeginning = 0;
  39. fsFromCurrent = 1;
  40. fsFromEnd = 2;
  41. Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
  42. Function FileCreate (Const FileName : String) : Longint;
  43. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  44. Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
  45. Function FileSeek (Handle,Offset,Origin : Longint) : Longint;
  46. Procedure FileClose (Handle : Longint);
  47. Function FileTruncate (Handle,Size: Longint) : boolean;
  48. Function FileAge (Const FileName : String): Longint;
  49. Function FileExists (Const FileName : String) : Boolean;
  50. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  51. Function FindNext (Var Rslt : TSearchRec) : Longint;
  52. Procedure FindClose (Var F : TSearchrec);
  53. Function FileGetDate (Handle : Longint) : Longint;
  54. Function FileSetDate (Handle,Age : Longint) : Longint;
  55. Function FileGetAttr (Const FileName : String) : Longint;
  56. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  57. Function DeleteFile (Const FileName : String) : Boolean;
  58. Function RenameFile (Const OldName, NewName : String) : Boolean;
  59. Function FileSearch (Const Name, DirList : String) : String;
  60. {
  61. $Log$
  62. Revision 1.8 2000-02-17 22:16:05 sg
  63. * Changed the second argument of FileWrite from "var buffer" to
  64. "const buffer", like in Delphi.
  65. Revision 1.7 2000/02/09 16:59:32 peter
  66. * truncated log
  67. Revision 1.6 2000/01/07 16:41:43 daniel
  68. * copyright 2000
  69. }