0
私はFile.getCanonicalPathは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();
}
}
}
、ファイルの正規のパスを取得するには、単純なJavaプログラムを使用しているNTFSストリームにそれが来るとき、それは例外
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)
に任意のアイデアを提起?
ドン」代わりに、** :: $ DATA **を使用してください。 java -jar Foo.jar "C:¥Users¥SamDev¥Documents¥NetBeansProjects¥MyThreads¥dist¥README.txt" $ DATA –