Skip to content

Commit

Permalink
#191 RefreshLinkDictionaryメソッドでターゲットパスを絶対パスに変換するよう修正した。テスト済み。
Browse files Browse the repository at this point in the history
  • Loading branch information
shimodateakira committed Sep 11, 2024
1 parent 8caec18 commit 7639b63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11040,7 +11040,7 @@ public void Indexer_Test14()

vs["/"] += new VirtualDirectory("dir1");
vs["/dir1"] += new VirtualItem<string>("item1", "Hello, World!");
vs["/dir1"] += new VirtualSymbolicLink("link1", "/dir1/item1"); // #191 ターゲットを相対パスにすると例外。
vs["/dir1"] += new VirtualSymbolicLink("link1", "./item1");
vs.RefreshLinkDictionary("/dir1/link1");

Debug.WriteLine("\nTree:");
Expand Down
5 changes: 4 additions & 1 deletion AkiraNetwork/VirtualStorageLibrary/VS.LinkManagement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,11 @@ public void RefreshLinkDictionary(VirtualPath linkPath)
}
else
{
// Use the directory path where the symbolic link was created as the base
VirtualPath absoluteTargetPath = ConvertToAbsolutePath(link.TargetPath, linkDirectoryPath).NormalizePath();

// If no matching link paths were found, add the new link to the dictionary using the provided link path
AddLinkToDictionary(link.TargetPath, linkPath);
AddLinkToDictionary(absoluteTargetPath, linkPath);

// Directly set the TargetNodeType for the newly added link
link.TargetNodeType = GetNodeType(link.TargetPath, true);
Expand Down

0 comments on commit 7639b63

Please sign in to comment.