stat.inc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Jonas Maebe,
  4. member of the Free Pascal development team.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$ifndef FPC_USE_LIBC} // kernel record
  12. Stat = packed record
  13. st_dev : qword;
  14. __pad0_ : array[0..3] of byte;
  15. __st_ino_,
  16. st_mode,
  17. st_nlink,
  18. st_uid,
  19. st_gid : cardinal;
  20. st_rdev : qword;
  21. __pad3_ : array[0..3] of byte;
  22. st_size : qword;
  23. st_blksize: cardinal;
  24. st_blocks : qword;
  25. st_atime,
  26. st_atime_nsec,
  27. st_mtime,
  28. st_mtime_nsec,
  29. st_ctime,
  30. st_ctime_nsec : cardinal;
  31. st_ino : qword;
  32. end;
  33. {$else}
  34. // info taken from /usr/include/asm-i386/stat.h you must have some -dev installed for this I think.. or linux-headers
  35. {$packrecords C}
  36. {$ifdef fs32bit}
  37. Stat = Record
  38. st_dev: cuLong;
  39. st_ino: cuLong;
  40. st_mode: cuShort;
  41. st_nlink: cuShort;
  42. st_uid: cuShort;
  43. st_gid: cuShort;
  44. st_rdev: cuLong;
  45. st_size: cuLong;
  46. st_blksize: cuLong;
  47. st_blocks: cuLong;
  48. st_atime: cuLong;
  49. st_atime_nsec: cuLong;
  50. st_mtime: cuLong;
  51. st_mtime_nsec: cuLong;
  52. st_ctime: cuLong;
  53. st_ctime_nsec: cuLong;
  54. __unused4_: cuLong;
  55. __unused5_: cuLong;
  56. end;
  57. {$else} // 64 bit stat
  58. Stat = record
  59. st_dev: cuLongLong;
  60. __pad0_: array[0..3] of cuChar;
  61. __st_ino: cuLong;
  62. st_mode: cuInt;
  63. st_nlink: cuInt;
  64. st_uid: cuLong;
  65. st_gid: cuLong;
  66. st_rdev: cuLongLong;
  67. __pad3_: array[0..3] of cuChar;
  68. st_size: cLongLong;
  69. st_blksize: cuLong;
  70. st_blocks: cuLongLong; //* Number 512-byte blocks allocated. */
  71. st_atime: cuLong;
  72. st_atime_nsec: cuLong;
  73. st_mtime: cuLong;
  74. st_mtime_nsec: cuInt;
  75. st_ctime: cuLong;
  76. st_ctime_nsec: cuLong;
  77. st_ino: cuLongLong;
  78. end;
  79. {$endif}
  80. {$endif}