ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles Scokart" <gscok...@gmail.com>
Subject Re: DirectoryScanner and Symlinks
Date Fri, 05 Sep 2008 09:45:31 GMT
2008/9/5 Stefan Bodewig <bodewig@apache.org>:
> On Fri, 5 Sep 2008, Gilles Scokart <gscokart@gmail.com> wrote:
>
>> 2008/9/5 Stefan Bodewig <bodewig@apache.org>:
>>> On Thu, 4 Sep 2008, Peter Reilly <peter.kitt.reilly@gmail.com> wrote:
>>>
>>>> Is it not costly (as in very costly) to get the canonical path ?
>>>
>>> That's what I've been told but I've never measured it.
>>>
>>> Currently DirectoryScanner avoids looking at the canonical path
>>> unless followSymlinks is false.  The problem with infinite loops
>>> caused by symlinks only happens if followSymlinks is true - so any
>>> solution to the problem will make DirectoryScanner look up
>>> canonical paths more often and thus probably make scanning slower.
>>>
>>
>> Instead of checking the canonical path, we could maybe check to path
>> in which we want to recurse.
>
> I don't think I understand what you mean here.
>
> The directory listing of base will show a single child directory A
> with no indication that this is a link (the only way to find out is to
> get the canonical path).
>
>> The only case where we need to check for symlink is when we are in
>> A/base and want to recurse in a directory name A.
>
> How do we know this would be a recursion without checking the
> canonical path?
>
> Stefan


Instead of checking for every directory if it is a symlink, we first
scan the path name.  If we want to go into a directory A, we check if
we have already traversed a directory A.  We don't need any file
system acces for that.  And its only when we detect that out recusive
path will contains two A that we check if those two A have the same
canonical path.


But the more I think to it, the more I am in favor of a solution that
simply fail the build properly by indiciating that an infinite
recursive pattern has been used.  It is much simpler to implement, and
probably more intuitive.



-- 
Gilles Scokart

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


Mime
View raw message