Posted By:
bryan_rall
Posted On:
Wednesday, August 4, 2004 09:37 AM
I am attempting to use the java.io.File class to access files on a *nix system that have international characters and I am getting some strange results. I have tested this test case on Red Hat Linux 3.2 JSE 1.4.2_04 and Solaris 9 1.4.2. Here is the setup: I have a directory with two files f1.txt and arrancó.txt ls temp arranc?.txt f1.txt Im running this test program on this directory to simply list the contents of the directory and check each file that is returned to see if it exits: File f = new File(argv[0]); File ls[] = f.listFiles(); String line; for (int i = 0; i < ls.length; i++) { File l = ls[i]; System.out.println("File:"+l
More>>
I am attempting to use the java.io.File class to access files on a *nix system that have international characters and I am getting some strange results. I have tested this test case on Red Hat Linux 3.2 JSE 1.4.2_04 and Solaris 9 1.4.2. Here is the setup: I have a directory with two files f1.txt and arrancó.txt
ls temp
arranc?.txt f1.txt
Im running this test program on this directory to simply list the contents of the directory and check each file that is returned to see if it exits:
File f = new File(argv[0]);
File ls[] = f.listFiles();
String line;
for (int i = 0; i
< ls.length; i++) {
File l = ls[i];
System.out.println("File:"+l.getPath()+" "+l.exists());
}
Here is the here is the output of the program:
File:temp/f1.txt true
File:temp/arranc?.txt false
As a result I cant seem to do anything with that file arrancó.txt. All subsequent IO operations fail. Any idea how to get around this problem?
Thanks,
--BRYAN RALL
<<Less