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

Gary,
Here's some excerpts from the standard and the specifics for each relevant
POSIX function. I put astericks next to statements that are of importance
for the implementation. The situation is better than I had thought due to
the possibility of delaying file times updates.
-----------------------------------------------------
POSIX Requirements for File Times Updates
Each file has 3 time values that are updated when
1. atime - file data has been accessed (i.e. read)
2. mtime - file data has been modified (i.e. write)
3. ctime - file status has been changed (i.e. chmod)
For each of the functions listed below, the appropriate time-related
fields are noted as "marked for update".
**** An implementation may update fields that are marked for update
immediately, or may update such fields periodically.****
When the fields are updated, they are set to the current time and the
update marks are cleared. All files that are marked for update shall
be updated when the file is no longer open by any process,
or when a stat or fstat (NtQueryInformationFile) is done. Other times
at which updates are done are unspecified.
**** Updates are not done for files on read-only file systems. ****
By function:
DONE
readdir -
atime of DIRECTORY updated each time is actually read.
NtQueryDirectoryFile for FileNamesInformation
open -
If O_CREAT and file didn't previously exist, update atime, ctime,
and mtime of FILE and PARENT DIRECTORY.
NtCreateFile -
DesiredAccess=SYNCHRONIZE|READ_CONTROL|FILE_READ_ATTRIBUTES|FILE_READ_EA
or'ed with FILE_READ_DATA, FILE_WRITE_DATA, or both, or
FILE_APPEND_DATA.
ShareAccess = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE
FileAttributes = FILE_ATTRIBUTE_NORMAL.
If O_TRUNC and file did exist, update ctime and mtime of FILE.
NtOpenFile with access same as above.
creat - Same as open with O_CREAT and O_TRUNC.
mkdir - Update atime, ctime, and mtime of DIRECTORY; update ctime and
mtime of PARENT DIRECTORY.
NtCreateFile -
DesiredAccess = 0L; ShareAccess = 0L.
FileAttributes = FILE_ATTRIBUTE_NORMAL.
mkfifo - Update atime, ctime, mtime of FILE. Update ctime, mtime of PARENT
DIRECTORY.
NtCreateFile -
DesiredAccess = FILE_READ_DATA; ShareAccess = 0L.
FileAttributes = FILE_ATTRIBUTE_SYSTEM.
pipe - atime, ctime, and mtime of pipe
Done in psx subsystem now - may take explicit setting of times.
-------------------------------------
TO BE DONE (should be complete before December 15 - I will update at that time)
link - Update ctime of FILE, ctime and mtime of PARENT DIRECTORY containing
new entry.
NtSetInformationFile
unlink - Update ctime of FILE unless link count goes to 0, ctime and mtime
of PARENT DIRECTORY.
NtSetInformationFile
rmdir - ctime and mtime of PARENT DIRECTORY.
NtSetInformationFile
rename - Update ctime and mtime of PARENT DIRECTORY of each file.
NtSetInformationFile
chmod - ctime of FILE.
NtSetInformationFile
chown - ctime of FILE.
NtSetInformationFile
utime - ctime of FILE
NtSetInformationFile
read - atime of FILE
NtReadFile
write - ctime and mtime of FILE.
NtWriteFile