2016-12-06 6 views
0

私は、Javaプログラム内の他のディレクトリへのハードリンクをディレクトリに作成しました。 (ファイルへのリンクではないので) https://docs.oracle.com/javase/tutorial/essential/io/links.htmlを使用しましたが動作しません。あなたの助けのための 感謝:) exact same documentation that you linked to in the questionからWindows用のjavaでディレクトリのハードリンクを作成する

private static void creatlink(Path newLink, Path target) throws IOException { 
    try { 
     Files.createLink(newLink, target); 
    } catch (IOException x) { 
     System.err.println(x); 
     } 
} 
+0

エラーログがいいです。使用:x.printStackTrace(); – Flummox

答えて

1

ハードリンクは、一般的に、ディレクトリ上で許可されていません。

本当に簡単です。私が気づいているオペレーティングシステムでは、あなたがしようとしていることはできません。 (ありますsome discussion here.

関連する問題