private void CheckStatfsResultAndThrowIfNecessary(int result)
{
if (result != 0)
{
var errorInfo = Interop.Sys.GetLastErrorInfo();
if (errorInfo.Error == Interop.Error.ENOENT)
{
throw new DriveNotFoundException(SR.Format(SR.IO_DriveNotFound_Drive, Name)); // match Win32
}
else
{
throw Interop.GetExceptionForIoErrno(errorInfo, isDirectory: true);
}
}
}
}