浏览代码

update SwapFiles

Luke Pulverenti 8 年之前
父节点
当前提交
c53ab214c7
共有 1 个文件被更改,包括 2 次插入27 次删除
  1. 2 27
      Emby.Common.Implementations/IO/ManagedFileSystem.cs

+ 2 - 27
Emby.Common.Implementations/IO/ManagedFileSystem.cs

@@ -490,38 +490,13 @@ namespace Emby.Common.Implementations.IO
             var temp1 = Path.GetTempFileName();
             var temp1 = Path.GetTempFileName();
 
 
             // Copying over will fail against hidden files
             // Copying over will fail against hidden files
-            RemoveHiddenAttribute(file1);
-            RemoveHiddenAttribute(file2);
+            SetHidden(file1, false);
+            SetHidden(file2, false);
 
 
             CopyFile(file1, temp1, true);
             CopyFile(file1, temp1, true);
 
 
             CopyFile(file2, file1, true);
             CopyFile(file2, file1, true);
             CopyFile(temp1, file2, 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)
         public bool ContainsSubPath(string parentPath, string path)