Created
October 2, 2021 10:49
-
-
Save yutopp/38190f1631f63a81f12fff1a8fdb4366 to your computer and use it in GitHub Desktop.
This file contains 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 characters
mono 5.10.1 | |
``` | |
path = tmp/tmp2/aaa | |
parent ToString() = tmp/tmp2 | |
parent Name = tmp2 | |
parent FullName = /home/tmp/tmp2 | |
``` |
This file contains 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 characters
mono 6.0.0 | |
``` | |
path = tmp/tmp2/aaa | |
parent ToString() = /home/tmp/tmp2 | |
parent Name = tmp2 | |
parent FullName = /home/tmp/tmp2 | |
``` |
This file contains 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 characters
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"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment