Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.0 KiB

  1. Gary,
  2. Here's some excerpts from the standard and the specifics for each relevant
  3. POSIX function. I put astericks next to statements that are of importance
  4. for the implementation. The situation is better than I had thought due to
  5. the possibility of delaying file times updates.
  6. -----------------------------------------------------
  7. POSIX Requirements for File Times Updates
  8. Each file has 3 time values that are updated when
  9. 1. atime - file data has been accessed (i.e. read)
  10. 2. mtime - file data has been modified (i.e. write)
  11. 3. ctime - file status has been changed (i.e. chmod)
  12. For each of the functions listed below, the appropriate time-related
  13. fields are noted as "marked for update".
  14. **** An implementation may update fields that are marked for update
  15. immediately, or may update such fields periodically.****
  16. When the fields are updated, they are set to the current time and the
  17. update marks are cleared. All files that are marked for update shall
  18. be updated when the file is no longer open by any process,
  19. or when a stat or fstat (NtQueryInformationFile) is done. Other times
  20. at which updates are done are unspecified.
  21. **** Updates are not done for files on read-only file systems. ****
  22. By function:
  23. DONE
  24. readdir -
  25. atime of DIRECTORY updated each time is actually read.
  26. NtQueryDirectoryFile for FileNamesInformation
  27. open -
  28. If O_CREAT and file didn't previously exist, update atime, ctime,
  29. and mtime of FILE and PARENT DIRECTORY.
  30. NtCreateFile -
  31. DesiredAccess=SYNCHRONIZE|READ_CONTROL|FILE_READ_ATTRIBUTES|FILE_READ_EA
  32. or'ed with FILE_READ_DATA, FILE_WRITE_DATA, or both, or
  33. FILE_APPEND_DATA.
  34. ShareAccess = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE
  35. FileAttributes = FILE_ATTRIBUTE_NORMAL.
  36. If O_TRUNC and file did exist, update ctime and mtime of FILE.
  37. NtOpenFile with access same as above.
  38. creat - Same as open with O_CREAT and O_TRUNC.
  39. mkdir - Update atime, ctime, and mtime of DIRECTORY; update ctime and
  40. mtime of PARENT DIRECTORY.
  41. NtCreateFile -
  42. DesiredAccess = 0L; ShareAccess = 0L.
  43. FileAttributes = FILE_ATTRIBUTE_NORMAL.
  44. mkfifo - Update atime, ctime, mtime of FILE. Update ctime, mtime of PARENT
  45. DIRECTORY.
  46. NtCreateFile -
  47. DesiredAccess = FILE_READ_DATA; ShareAccess = 0L.
  48. FileAttributes = FILE_ATTRIBUTE_SYSTEM.
  49. pipe - atime, ctime, and mtime of pipe
  50. Done in psx subsystem now - may take explicit setting of times.
  51. -------------------------------------
  52. TO BE DONE (should be complete before December 15 - I will update at that time)
  53. link - Update ctime of FILE, ctime and mtime of PARENT DIRECTORY containing
  54. new entry.
  55. NtSetInformationFile
  56. unlink - Update ctime of FILE unless link count goes to 0, ctime and mtime
  57. of PARENT DIRECTORY.
  58. NtSetInformationFile
  59. rmdir - ctime and mtime of PARENT DIRECTORY.
  60. NtSetInformationFile
  61. rename - Update ctime and mtime of PARENT DIRECTORY of each file.
  62. NtSetInformationFile
  63. chmod - ctime of FILE.
  64. NtSetInformationFile
  65. chown - ctime of FILE.
  66. NtSetInformationFile
  67. utime - ctime of FILE
  68. NtSetInformationFile
  69. read - atime of FILE
  70. NtReadFile
  71. write - ctime and mtime of FILE.
  72. NtWriteFile