mirror of
https://github.com/Radarr/Radarr
synced 2025-02-25 07:32:56 +00:00
Revert "Fixed: FolderWritable check for CIFS shares mounted in Unix"
This reverts commit a71874db8d
.
This commit is contained in:
parent
140547e42a
commit
8c892a732e
1 changed files with 2 additions and 11 deletions
|
@ -131,7 +131,7 @@ public bool FolderWritable(string path)
|
|||
{
|
||||
var testPath = Path.Combine(path, "radarr_write_test.txt");
|
||||
var testContent = string.Format("This file was created to verify if '{0}' is writable. It should've been automatically deleted. Feel free to delete it.", path);
|
||||
WriteAllText(testPath, testContent);
|
||||
File.WriteAllText(testPath, testContent);
|
||||
File.Delete(testPath);
|
||||
return true;
|
||||
}
|
||||
|
@ -300,16 +300,7 @@ public void WriteAllText(string filename, string contents)
|
|||
{
|
||||
Ensure.That(filename, () => filename).IsValidPath();
|
||||
RemoveReadOnly(filename);
|
||||
|
||||
// File.WriteAllText is broken on net core when writing to some CIFS mounts
|
||||
// This workaround from https://github.com/dotnet/runtime/issues/42790#issuecomment-700362617
|
||||
using (var fs = new FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None))
|
||||
{
|
||||
using (var writer = new StreamWriter(fs))
|
||||
{
|
||||
writer.Write(contents);
|
||||
}
|
||||
}
|
||||
File.WriteAllText(filename, contents);
|
||||
}
|
||||
|
||||
public void FolderSetLastWriteTime(string path, DateTime dateTime)
|
||||
|
|
Loading…
Reference in a new issue