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 <Rolf.Schumacher@hamburg.de>
>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: <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>