aboutsummaryrefslogtreecommitdiff
path: root/Emby.Common.Implementations/IO/ManagedFileSystem.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-27 02:25:51 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-12-27 02:25:51 -0500
commitc53ab214c783b471e3701fbc7a2319139c38fa9a (patch)
tree7062df10330ad2133677d225d5ef69185daf6243 /Emby.Common.Implementations/IO/ManagedFileSystem.cs
parent8999198cca1f3808f01672f6126e72df598ec24e (diff)
update SwapFiles
Diffstat (limited to 'Emby.Common.Implementations/IO/ManagedFileSystem.cs')
-rw-r--r--Emby.Common.Implementations/IO/ManagedFileSystem.cs29
1 files changed, 2 insertions, 27 deletions
diff --git a/Emby.Common.Implementations/IO/ManagedFileSystem.cs b/Emby.Common.Implementations/IO/ManagedFileSystem.cs
index 62d285072..78070a5d9 100644
--- a/Emby.Common.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Common.Implementations/IO/ManagedFileSystem.cs
@@ -490,38 +490,13 @@ namespace Emby.Common.Implementations.IO
var temp1 = Path.GetTempFileName();
// Copying over will fail against hidden files
- RemoveHiddenAttribute(file1);
- RemoveHiddenAttribute(file2);
+ SetHidden(file1, false);
+ SetHidden(file2, false);
CopyFile(file1, temp1, true);
CopyFile(file2, file1, true);
CopyFile(temp1, file2, true);
-
- DeleteFile(temp1);
- }
-
- /// <summary>
- /// Removes the hidden attribute.
- /// </summary>
- /// <param name="path">The path.</param>
- private void RemoveHiddenAttribute(string path)
- {
- if (string.IsNullOrEmpty(path))
- {
- throw new ArgumentNullException("path");
- }
-
- var currentFile = new FileInfo(path);
-
- // This will fail if the file is hidden
- if (currentFile.Exists)
- {
- if ((currentFile.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
- {
- currentFile.Attributes &= ~FileAttributes.Hidden;
- }
- }
}
public bool ContainsSubPath(string parentPath, string path)