The Win32 call SetFileTime() allows setting file access time, creation time,
and modification time. Samba allows modification time to be changed, but not access time.
If SetFileTime is used to set *only* the atime (passing NULL for the other times), then the atime is not set. If SetFileTime is used to set both atime and mtime, then the atime (and mtime) is set correctly but to the same value.
This has been noted occasionally in the past:
Do you have a win32 test program I can use to ensure we do
the correct thing here ?
That would help before I apply either of these patches.
Something like this should do it. This creates a file "thefile.txt". If all is well SetFileTime-wise, the access time (and only the access time) of this file will be set to January 1, 2000.
main(int argc,char *argv)
printf("Can't parse time\n");
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_DELETE,
printf("Can't create file\n");
printf("Can't set atime\n");
works well for me with current samba versions. If you still see a problem with this, please reopen the bug.