aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-07-19 17:16:13 +0200
committerGitHub <noreply@github.com>2020-07-19 17:16:13 +0200
commitce07e458976c8d20985c4afa731d8a80f58a5303 (patch)
tree08395304a0437145ef2745c7f442c4e73913a424
parent8ac08499bc47caf17d029fe10605da6c335a48e5 (diff)
parenteea142cad1d3bfe49f3fb804902b3346174c31ea (diff)
Merge pull request #3585 from Ken-g6/2354-soft-link-sizes
2354 fix soft link sizes
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index a3a3f91b7..ab6483bf9 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -245,6 +245,16 @@ namespace Emby.Server.Implementations.IO
if (info is FileInfo fileInfo)
{
result.Length = fileInfo.Length;
+
+ // Issue #2354 get the size of files behind symbolic links
+ if (fileInfo.Attributes.HasFlag(FileAttributes.ReparsePoint))
+ {
+ using (Stream thisFileStream = File.OpenRead(fileInfo.FullName))
+ {
+ result.Length = thisFileStream.Length;
+ }
+ }
+
result.DirectoryName = fileInfo.DirectoryName;
}