diff --git a/src/Ramstack.FileSystem.Physical/PhysicalFileSystem.cs b/src/Ramstack.FileSystem.Physical/PhysicalFileSystem.cs index cadf419..70346e5 100644 --- a/src/Ramstack.FileSystem.Physical/PhysicalFileSystem.cs +++ b/src/Ramstack.FileSystem.Physical/PhysicalFileSystem.cs @@ -5,10 +5,13 @@ namespace Ramstack.FileSystem.Physical; /// /// Represents an implementation of for physical files. /// -[DebuggerDisplay("Root = {_root,nq}")] +[DebuggerDisplay("Root = {Root,nq}")] public sealed class PhysicalFileSystem : IVirtualFileSystem { - private readonly string _root; + /// + /// Gets the physical path of the root directory for this instance. + /// + public string Root { get; } /// /// Gets or sets a value indicating whether the file system is read-only. @@ -18,13 +21,13 @@ public sealed class PhysicalFileSystem : IVirtualFileSystem /// /// Initializes a new instance of the class. /// - /// The physical path of the directory. + /// The physical path of root the directory. public PhysicalFileSystem(string path) { if (!Path.IsPathRooted(path)) Error(path); - _root = Path.GetFullPath(path); + Root = Path.GetFullPath(path); static void Error(string path) => throw new ArgumentException($"The path '{path}' must be absolute."); @@ -64,6 +67,6 @@ void IDisposable.Dispose() private string GetPhysicalPath(string path) { Debug.Assert(VirtualPath.IsNormalized(path)); - return Path.Join(_root, path); + return Path.Join(Root, path); } }