FAQ
Thanks, Stefan.
Sorry I'm not so professional in Ant - do not know what you mean by
"File#list".
What I've done is a simle Test:

import java.io.File;
public class Test {
public static void main(String[] args) {
File[] fs = (new File("C:\\")).listFiles();
for(int i=0; i<fs.length; i++) {
System.out.println(fs[i].getAbsolutePath());
}
}
}

This lists all top level files correctly without errors.
Including "System Volume Information".
What I thought is that Ant shoulde to stop here, not going further.
It should evalutate the resulting strings (here in fs)
against the filter <exclude name="**\System*\**> (or equiv.)
prior to touching "C:\\System Volume Information".
And than refuse to touch it.

However, if I change my little test and do a touch to that file as in

import java.io.File;
public class Test {
public static void main(String[] args) {
File f = new File("C:\\System Volume Information");
if (f.isDirectory()) {
System.out.println("is directory");
File[] fs = f.listFiles();
if ( fs == null ) {
System.out.println("directory is empty");
}
}
}
}

I got no errors only my message that this directory is empty.

It looks to me as if I don't see the wood for the trees
or Ant touches the File in a more complex way to generate its error.
I'm looking forward to overcome my blindness or crack this damn thing.

Rolf

Stefan Bodewig wrote:
On Thu, 14 Nov 2002, Rolf Schumacher wrote:


It should not touch the directory System Volume Information. I
believe that this is a special entry in the directory that leads to
an error message even if ant asks for read only.
I'm afraid this happens before Ant actually looks at the file names.

If you do a File#list on C:\ from a simple test program, do you get
similar errors? It looks as if listing it may be enough to get you
into trouble (as Ant really shouldn't try to access it after that).

Stefan

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



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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 10 of 12 | next ›
Discussion Overview
groupuser @
categoriesant
postedNov 14, '02 at 11:21a
activeNov 21, '02 at 10:38a
posts12
users4
websiteant.apache.org

People

Translate

site design / logo © 2018 Grokbase