Set a files timestamp or copy a file with identical date

Herbert König herbertkoenig at gmx.net
Sun May 8 07:25:01 UTC 2005


Hello Squeakers,

for synchronising of file directories I need to copy files without
changing the date and time of creation and modification.

Copying the file can be done with FileDirectory>>copyFile:toFile: but
this creates a new file with new timestamps.  But I can't find a
method to set (change) the timestamp in FileDirectory or
DirectoryEntry.

I also tried Win32Shell's methods, but as far as I understand it,
shell32 is not the module that contains the copy or xcopy commands.

So how to go about copying a file without changing the timestamp?

I' prefer a way which is independent of the OS, but better using FFI
than not getting it done :-))

As I think again, I'm sure I could write a "mycopy.bat" batch file
containing lines like:
copy path1\file1 path2...
copy path1\file2 path2...
and then do a
Win32Shell new shellOpen: 'mycopy.bat'
but I hope it doesn't get that bad.
  

Best regards,

Herbert                          mailto:herbertkoenig at gmx.net




More information about the Squeak-dev mailing list