Set a files timestamp or copy a file with identical date

David T. Lewis lewis at mail.msen.com
Sun May 8 14:28:25 UTC 2005


On Sun, May 08, 2005 at 09:25:01AM +0200, Herbert König wrote:
> 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.

FileDirectory>>rename:toBe: will move the file without changing file
attributes. But I don't know of a platform-independent way to make
a new copy of a file with the attributes preserved.

Actually, Squeak has its own limited notion of "file attributes"
that it maps to the underlying file systems, which have differing
and usually more complicated notions of the "attributes" of files.
So this is an issue that may be inherently platform-specific, and
it may be best if Squeak does not try to handle it.

Dave




More information about the Squeak-dev mailing list