You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by David Cassidy <da...@db.com> on 2003/07/28 15:39:46 UTC

getCanonicalPath used rather than getAbsolutePath

Guys,

We deploy tomcat in a multi-hosting environment. We make rather extensive use of symlinks so that we can
update the system. ie when the user wants to publish their content the symlink is changed and hey bingo ...

The problem we're finding is that tomcat is expanding the symlink to the real path. At midnight we kinda
clean the system so that old dead versions are removed to save disk space etc.

Of course then tomcat gets broken due the the file not being there.
I've checked the source of Tomcat 4.1.24 and it seems that getCanonicalPath and getAbsolutePath
have been used interchangably.

Is there a reason for this ?

If not taken as though the two methods return the same(ish *) result can we have getAbsolutePath used
exclusivly ?

Many thanks

David

* they both return the absolute path, just is getCanonicalPath expands symlinks to the real dir name.


--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: getCanonicalPath used rather than getAbsolutePath

Posted by Remy Maucherat <re...@apache.org>.
David Cassidy wrote:
> Guys,
> 
> We deploy tomcat in a multi-hosting environment. We make rather extensive use of symlinks so that we can
> update the system. ie when the user wants to publish their content the symlink is changed and hey bingo ...
> 
> The problem we're finding is that tomcat is expanding the symlink to the real path. At midnight we kinda
> clean the system so that old dead versions are removed to save disk space etc.
> 
> Of course then tomcat gets broken due the the file not being there.
> I've checked the source of Tomcat 4.1.24 and it seems that getCanonicalPath and getAbsolutePath
> have been used interchangably.
> 
> Is there a reason for this ?
> 
> If not taken as though the two methods return the same(ish *) result can we have getAbsolutePath used
> exclusivly ?

No, sorry.

> * they both return the absolute path, just is getCanonicalPath expands symlinks to the real dir name.

It does much more than that (ex: removing stuff like /./, etc): it is a 
minimal access path to the file (starting from the filesystem root).

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org