2017-12-03 21:00:07 +00:00
|
|
|
using System.Collections.Generic;
|
2016-07-27 05:40:54 +00:00
|
|
|
using System.IO;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
|
|
|
|
namespace NzbDrone.Mono.Disk
|
|
|
|
{
|
|
|
|
public static class FindDriveType
|
|
|
|
{
|
2024-04-08 18:44:07 +00:00
|
|
|
private static readonly Dictionary<string, DriveType> DriveTypeMap = new ()
|
|
|
|
{
|
|
|
|
{ "afpfs", DriveType.Network },
|
|
|
|
{ "apfs", DriveType.Fixed },
|
|
|
|
{ "fuse.mergerfs", DriveType.Fixed },
|
|
|
|
{ "fuse.shfs", DriveType.Fixed },
|
|
|
|
{ "fuse.glusterfs", DriveType.Network },
|
|
|
|
{ "nullfs", DriveType.Fixed },
|
|
|
|
{ "zfs", DriveType.Fixed }
|
|
|
|
};
|
2016-07-27 05:40:54 +00:00
|
|
|
|
|
|
|
public static DriveType Find(string driveFormat)
|
|
|
|
{
|
2016-08-31 05:23:49 +00:00
|
|
|
if (driveFormat.IsNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
return DriveType.Unknown;
|
|
|
|
}
|
|
|
|
|
2016-07-27 05:40:54 +00:00
|
|
|
return DriveTypeMap.GetValueOrDefault(driveFormat);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|