Merge pull request #3585 from Ken-g6/2354-soft-link-sizes
2354 fix soft link sizes
This commit is contained in:
commit
ce07e45897
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user