Merge pull request #5106 from BaronGreenback/FileShareTest2

(cherry picked from commit 28ffbf6945)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
pull/5296/head
Bond-009 3 years ago committed by Joshua M. Boniface
parent a934477850
commit d816995d27

@ -202,10 +202,11 @@ namespace MediaBrowser.XbmcMetadata.Savers
{
Directory.CreateDirectory(Path.GetDirectoryName(path));
// On Windows, savint the file will fail if the file is hidden or readonly
// On Windows, saving the file will fail if the file is hidden or readonly
FileSystem.SetAttributes(path, false, false);
using (var filestream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read))
// use FileShare.None as this bypasses dotnet bug dotnet/runtime#42790 .
using (var filestream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
{
stream.CopyTo(filestream);
}

Loading…
Cancel
Save