New
#1
Windows 7: can't change last write time of .eml file
Hello,
I have encountered a problem involving .eml files that I cannot explain.
I wonder whether anyone knows something about it.
I have a backup/restore program that scans all my files, and copies new
and updated files to a USB key. When I start working on a different computer
the program performs the reverse operation. After each file copy, the
last write time of the target file is set to that of the source file.
The program works without problems, except that for a subset of files with
the extension .eml the last write time refuses to be changed. The change of
the last write time is performed with the Win32 API function SetFileTime.
The strange part is that SetFileTime returns a "success" value; however, on
examination of the file properties it is seen that the time has not been
set properly. Stranger still, when the program is run with a debugger, the
last write time is set correctly.
I have tried all possible things; for example, I tried running the program
with administrator rights, I tried sleeping the program for a while before
changing the last write time, etc. None of these things worked. The only
thing that does work is changing the extension of the .eml files. When the
extension is changed, the program works normally.
Can anyone explain this behavior?
Regards,
bostjanv