Will now also automatically revert to a fully transactional move/copy if the move is in our out of a cifs mount. (assuming the cifs mount can be detected)pull/1037/merge
parent
f5b3d70641
commit
97cdb6a4a5
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Common.Disk
|
||||
{
|
||||
public interface IMount
|
||||
{
|
||||
long AvailableFreeSpace { get; }
|
||||
string DriveFormat { get; }
|
||||
DriveType DriveType { get; }
|
||||
bool IsReady { get; }
|
||||
string Name { get; }
|
||||
string RootDirectory { get; }
|
||||
long TotalFreeSpace { get; }
|
||||
long TotalSize { get; }
|
||||
string VolumeLabel { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using Mono.Unix;
|
||||
|
||||
namespace NzbDrone.Mono
|
||||
{
|
||||
public class ProcMount : IMount
|
||||
{
|
||||
private readonly UnixDriveInfo _unixDriveInfo;
|
||||
|
||||
public ProcMount(DriveType driveType, string name, string mount, string type, Dictionary<string, string> options)
|
||||
{
|
||||
DriveType = driveType;
|
||||
Name = name;
|
||||
RootDirectory = mount;
|
||||
DriveFormat = type;
|
||||
|
||||
_unixDriveInfo = new UnixDriveInfo(mount);
|
||||
}
|
||||
|
||||
public long AvailableFreeSpace
|
||||
{
|
||||
get { return _unixDriveInfo.AvailableFreeSpace; }
|
||||
}
|
||||
|
||||
public string DriveFormat { get; private set; }
|
||||
|
||||
public DriveType DriveType { get; private set; }
|
||||
|
||||
public bool IsReady
|
||||
{
|
||||
get { return _unixDriveInfo.IsReady; }
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string RootDirectory { get; private set; }
|
||||
|
||||
public long TotalFreeSpace
|
||||
{
|
||||
get { return _unixDriveInfo.TotalFreeSpace; }
|
||||
}
|
||||
|
||||
public long TotalSize
|
||||
{
|
||||
get { return _unixDriveInfo.TotalSize; }
|
||||
}
|
||||
|
||||
public string VolumeLabel
|
||||
{
|
||||
get { return _unixDriveInfo.VolumeLabel; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue