You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2014/03/03 14:39:15 UTC

DirectoryScanner and "strange" File entities

Hi all,

I've been looking into Bugzilla 56149.  There is a named pipe scanned by
DirectoryScanner and DS seems to treat it like a directory.

The reporter of the bug confirmed File.isFile and File.isDirectory both
return false for the named pipe so this is something we can detect and
something DirectoryScanner doesn't expext.  isFile is expected to be the
opposite of isDirectory in a few places.

I think it would be easy to add guards to only treat files as files and
dirs as dirs, the question is what to do with File objects that are
neither.  Drop them?  Treat them as files?  Add another user-controlled
option?

They seem to be rare creatures and in the context of issue 56149 "just
drop them" would probably be the sanest choice.

Stefan

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


Re: DirectoryScanner and "strange" File entities

Posted by Stefan Bodewig <bo...@apache.org>.
On 2014-03-03, Stefan Bodewig wrote:

> I think it would be easy to add guards to only treat files as files and
> dirs as dirs, the question is what to do with File objects that are
> neither.  Drop them?  Treat them as files?  Add another user-controlled
> option?

Thanks for the feedback, trunk should now drop those "file"s.

Stefan

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


Re: DirectoryScanner and "strange" File entities

Posted by Dominique Devienne <dd...@gmail.com>.
On Tue, Mar 4, 2014 at 5:05 AM, Conor MacNeill <co...@apache.org> wrote:
> I agree with Antoine, dropping seems the simplest.
>
> On 4 March 2014 14:57, Antoine Levy Lambert <an...@gmx.de> wrote:
>> just dropping them works for me.
>>
>> On Mar 3, 2014, at 8:39 AM, Stefan Bodewig <bo...@apache.org> wrote:
>>> I think it would be easy to add guards to only treat files as files and
>>> dirs as dirs, the question is what to do with File objects that are
>>> neither.  Drop them?  Treat them as files?  Add another user-controlled option?

Just drop them, I agree. --DD

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


Re: DirectoryScanner and "strange" File entities

Posted by Conor MacNeill <co...@apache.org>.
Stefan,

I agree with Antoine, dropping seems the simplest.

On 4 March 2014 14:57, Antoine Levy Lambert <an...@gmx.de> wrote:
> Hello Stefan,
>
> just dropping them works for me.
>
> Antoine
> On Mar 3, 2014, at 8:39 AM, Stefan Bodewig <bo...@apache.org> wrote:
>
>> Hi all,
>>
>> I've been looking into Bugzilla 56149.  There is a named pipe scanned by
>> DirectoryScanner and DS seems to treat it like a directory.
>>
>> The reporter of the bug confirmed File.isFile and File.isDirectory both
>> return false for the named pipe so this is something we can detect and
>> something DirectoryScanner doesn't expext.  isFile is expected to be the
>> opposite of isDirectory in a few places.
>>
>> I think it would be easy to add guards to only treat files as files and
>> dirs as dirs, the question is what to do with File objects that are
>> neither.  Drop them?  Treat them as files?  Add another user-controlled
>> option?
>>
>> They seem to be rare creatures and in the context of issue 56149 "just
>> drop them" would probably be the sanest choice.
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>

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


Re: DirectoryScanner and "strange" File entities

Posted by Antoine Levy Lambert <an...@gmx.de>.
Hello Stefan,

just dropping them works for me.

Antoine
On Mar 3, 2014, at 8:39 AM, Stefan Bodewig <bo...@apache.org> wrote:

> Hi all,
> 
> I've been looking into Bugzilla 56149.  There is a named pipe scanned by
> DirectoryScanner and DS seems to treat it like a directory.
> 
> The reporter of the bug confirmed File.isFile and File.isDirectory both
> return false for the named pipe so this is something we can detect and
> something DirectoryScanner doesn't expext.  isFile is expected to be the
> opposite of isDirectory in a few places.
> 
> I think it would be easy to add guards to only treat files as files and
> dirs as dirs, the question is what to do with File objects that are
> neither.  Drop them?  Treat them as files?  Add another user-controlled
> option?
> 
> They seem to be rare creatures and in the context of issue 56149 "just
> drop them" would probably be the sanest choice.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


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