VFSPathExtensions.GetParent(thisVFSPath,int).md
January 20, 2026 ยท View on GitHub
Atypical.VirtualFileSystem.Core
Atypical.VirtualFileSystem.Core.Extensions.VFSPathExtensions
VFSPathExtensions.GetParent(this VFSPath, int) Method
Gets the parent directory at the specified level up.
public static Atypical.VirtualFileSystem.Core.VFSDirectoryPath GetParent(this Atypical.VirtualFileSystem.Core.VFSPath path, int levels=1);
Parameters
path VFSPath
The VFS path.
levels System.Int32
Number of levels to go up. Default is 1.
Returns
VFSDirectoryPath
The parent directory at the specified level.
Exceptions
System.InvalidOperationException
Thrown when there's no parent at the specified level.