I use Beyond Compare to keep some files aligned in a couple places. The problem I had is once I updated changes and saved the modified file copies the file dates are different and when Beyond Compare is next opened I had to manually cycle through the files to make sure they were still aligned. Simple to fix in Delphi – compare the file contents and if they are the same align the file “Last Write” dates.
Some of my file directories are however on mapped drives on the VMWare Linux host
(Eg Z:\UnixData.Test.MyFile.Txt)
And while
TFile.GetLastWriteTime(‘ Z:\UnixData.Test.MyFile.Txt’);
returns the correct time.
SetLastWriteTime(‘Z:\UnixData.Test.MyFile.Txt’, NewTime);
has no effect.
Similarly Tfile.Copy with overwrite set to true will not work but if any existing file is deleted first the copy does proceed but the file dates are not copied.
I do have a solution. If I use the Samba access to the host files
SetLastWriteTime(‘\\HostName\Share\Directory\Tree\FileName.txt', NewTime);
all TFile functions work as as expected.
Why would VMWare Mapped Drives act this way?
I note that if I run my program as administrator the mapped drives do not appear.