I am updating an application that previously used AlphaFS to provide IO operations for local and network paths.
One of the functions is to return drive free and available space. This works fine if the drive is local or mapped using DriveInfo
var pathRoot = System.IO.Path.GetPathRoot(startPath);
var driveInfo = new DriveInfo(pathRoot);
AvailSpace = (ulong) driveInfo.AvailableFreeSpace;
TotalSpace = (ulong) driveInfo.TotalSize;
but for an unc path it will error with
Drive name must be a root directory (i.e. 'C:\') or a drive letter ('C').
Is there a suitable alternative to DriveInfo that can be used for network unc paths in .NET Core 3.x?