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: Sektor van Skijlen <ethouris@guess.if.gmail.com.is.valid.or.invalid>
Date: Tue Mar 21 2006 - 16:04:50 CET

Dnia Tue, 21 Mar 2006 11:28:55 +0000, Donal K. Fellows skrobie:
> 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".

I might argue that there should be an option to file copy:

% file copy -force -mtime $source $target

And it's fine. In particular, works as unix cp command.

-- 
//  _    ___         Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl>
\\ L_ |/ `|  /^\ ,()                         <ethourhs(O)gmail.com>
// \_ |\  \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx
"I am allergic to Java because programming in Java reminds me casting spells"
Received on Sun Apr 30 02:44:19 2006