aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-05-04 16:40:34 +0200
committerGitHub <noreply@github.com>2025-05-04 08:40:34 -0600
commit0c3ba30de214eddcd6118c3b695b08e5482bf7ed (patch)
treea862a90f6c78cd61f78e5af7b75611a37f527ccf /Emby.Server.Implementations/IO
parent4096c973c623a72525843d5fe278d1f36fbbc58a (diff)
Cleanup file related code (#14023)
Diffstat (limited to 'Emby.Server.Implementations/IO')
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index ac5933a69..077eb7945 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -159,13 +159,13 @@ namespace Emby.Server.Implementations.IO
catch (IOException)
{
// Cross device move requires a copy
- Directory.CreateDirectory(destination);
- foreach (string file in Directory.GetFiles(source))
+ var directory = Directory.CreateDirectory(destination);
+ foreach (var file in directory.EnumerateFiles())
{
- File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), true);
+ file.CopyTo(Path.Combine(destination, file.Name), true);
}
- Directory.Delete(source, true);
+ directory.Delete(true);
}
}