0
J'utilise un programme Java simple pour obtenir le chemin canonique d'un fichier,File.getCanonicalPath ne peut pas traiter les flux NTFS?
import java.io.*;
public class Foo {
public static void main (String[] args)
{
try {
File file = new File(args[0]);
System.out.println(file.getCanonicalPath());
} catch (Exception e) {
e.printStackTrace();
}
}
}
En matière de flux NTFS, il soulève exception
C:\>java Foo c:\windows\system32\calc.exe::$DATA
java.io.IOException: The filename, directory name, or volume label syntax is inc
orrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.WinNTFileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at Foo.main(Foo.java:8)
Toutes les idées?
Don » t utiliser ** :: $ DATA ** à la place utiliser java -jar Foo.jar "C: \ Utilisateurs \ SamDev \ Documents \ NetBeansProjects \ MyThreads \ dist \ README.txt" $ DATA –