Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetParent()

static ? DirectoryInfo System.IO.Directory.GetParent ( string path)
inlinestatic

Definition at line 9 of file Directory.cs.

10 {
11 if (path == null)
12 {
13 throw new ArgumentNullException("path");
14 }
15 if (path.Length == 0)
16 {
17 throw new ArgumentException(SR.Argument_PathEmpty, "path");
18 }
19 string fullPath = Path.GetFullPath(path);
20 string directoryName = Path.GetDirectoryName(fullPath);
21 if (directoryName == null)
22 {
23 return null;
24 }
25 return new DirectoryInfo(directoryName);
26 }

References System.SR.Argument_PathEmpty, System.IO.Path.GetDirectoryName(), and System.IO.Path.GetFullPath().

Referenced by ReLogic.IO.ConsoleOutputMirror.ConsoleOutputMirror(), and Terraria.IO.Preferences.Save().