tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Can't move files using symbolic links (allowLinking=true)
Date Mon, 21 Mar 2011 22:47:52 GMT
Caldarale, Charles R wrote:
>> From: [] On Behalf
Of Peter Crowther
>> Subject: Re: Can't move files using symbolic links (allowLinking=true)
>>> Maybe a guess : under Unix/Linux, "move" (mv) is a "rename",
>>> and it is not the same as "copy + delete original".  And a
>>> "move" (rename) works as long as the source and target are
>>> inside the same filesystem, but not if they are on different
>>> filesystems.
>> Nice one André!  I'd completely missed that.
> Except... I have no problem issuing a shell mv command across filesystems; the shell
recognizes that this is not just a simple rename() operation, and acts accordingly.  Note
that there is no move() API (for filesystems); the concept is a figment of the shell's imagination.
And me thinking I'd had a brilliant insight.  There's always got to be someone to spoil it..

The perl documentation for rename() though, has this to say :

     Changes the name of a file; an existing file NEWNAME will be clobbered. Returns true

for success, false otherwise.

     Behavior of this function varies wildly depending on your system implementation. For

example, it will usually not work across file system boundaries, even though the system mv

command sometimes compensates for this. Other restrictions include whether it works on 
directories, open files, or pre-existing files. Check the perlport manpage and either the

rename(2) manpage or equivalent system documentation for details.

perl itself being written in C, is usually pretty close to the C library.  But maybe the 
above is a bit dated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message