Skip to content

Commit 3dc9d53

Browse files
committed
(#239) AbsolutePath, Libc: cleanup, document that we ignore any errors
1 parent fb3e614 commit 3dc9d53

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎TruePath/AbsolutePath.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ public static AbsolutePath CurrentWorkingDirectory
131131
public LocalPath RelativeTo(AbsolutePath basePath) => new(PathPolyfills.GetRelativePath(basePath.Value, Value));
132132
#endif
133133
/// <summary>Corrects the file name case on case-insensitive file systems, resolves symlinks.</summary>
134+
/// <remarks>
135+
/// If the path cannot be resolved (e.g. it or one of its parent directories doesn't exist, or access to it is
136+
/// denied), this method doesn't throw and returns the path unchanged.
137+
/// </remarks>
134138
public AbsolutePath Canonicalize() => new(DiskUtils.GetRealPath(Value));
135139

136140
/// <summary>

‎TruePath/Libc.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ internal static class Libc
2626
/// </remarks>
2727
[DllImport("libc",
2828
EntryPoint = "realpath",
29-
SetLastError = true,
3029
CharSet = CharSet.Ansi)]
3130
internal static extern IntPtr RealPath(string path, IntPtr buffer);
3231

0 commit comments

Comments
 (0)