Created
October 2, 2021 10:49
Revisions
-
yutopp created this gist
Oct 2, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ mono 5.10.1 ``` path = tmp/tmp2/aaa parent ToString() = tmp/tmp2 parent Name = tmp2 parent FullName = /home/tmp/tmp2 ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ mono 6.0.0 ``` path = tmp/tmp2/aaa parent ToString() = /home/tmp/tmp2 parent Name = tmp2 parent FullName = /home/tmp/tmp2 ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ using System; using System.IO; class Program { static void Main() { var path = "tmp/tmp2/aaa"; System.Console.Write($"path = {path}\n"); var parentPath = Directory.GetParent(path).ToString(); System.Console.Write($"parent ToString() = {parentPath}\n"); var n0 = Directory.GetParent(path).Name; System.Console.Write($"parent Name = {n0}\n"); var n1 = Directory.GetParent(path).FullName; System.Console.Write($"parent FullName = {n1}\n"); } }