Re: [Tcl] file copy does not "touch" file. Why?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: [Tcl] file copy does not "touch" file. Why?

From: Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
Date: Tue Mar 21 2006 - 12:28:55 CET

Sektor van Skijlen wrote:
> In a situation, when both source and destination files exist, file copy (with
> -force of course) does not update the last modification time of the
> destination file. This "feature" has a strong impact on cooperation with
> 'make'.

It's that way because it makes it easier to do archival backups. If you
want the mtime of the destination to be *now*, try this:

  proc creatingFileCopy {source destination} {
     file copy $source $destination
     file mtime $destination [clock seconds]
  }

You might argue that there should be an option to tell [file copy] to
not copy the metadata. I'd probably not argue the matter, but currently
the metadata copy is done, since it's part of producing a "copy".

Donal.
Received on Sun Apr 30 02:43:17 2006