summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs')
-rw-r--r--win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
index d07056ef8..40bb2d5c0 100644
--- a/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
+++ b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs
@@ -49,5 +49,20 @@ namespace HandBrakeWPF.Utilities
return drives;
}
+
+ public static bool HasMinimumDiskSpace(string destination, long minimumInBytes)
+ {
+ string drive = Path.GetPathRoot(destination);
+ if (!string.IsNullOrEmpty(drive) && !drive.StartsWith("\\"))
+ {
+ DriveInfo c = new DriveInfo(drive);
+ if (c.AvailableFreeSpace < minimumInBytes)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
}
}