Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #158 from benjicoh/patch-1
Browse files Browse the repository at this point in the history
Fixes UnauthorizedException when extracting read only files
  • Loading branch information
squid-box committed Mar 22, 2023
2 parents 0a76267 + 6925d67 commit cf4831e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SevenZip/StreamWrappers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ internal sealed class InMultiStreamWrapper : MultiStreamWrapper, ISequentialInSt
int i = 0;
while (File.Exists(fileName))
{
Streams.Add(new FileStream(fileName, FileMode.Open));
Streams.Add(new FileStream(fileName, FileMode.Open, FileAccess.Read));
long length = Streams[i].Length;
StreamOffsets.Add(i++, new KeyValuePair<long, long>(StreamLength, StreamLength + length));
StreamLength += length;
Expand Down Expand Up @@ -505,4 +505,4 @@ private void OnBytesWritten(IntEventArgs e)
}
}
#endif
}
}

0 comments on commit cf4831e

Please sign in to comment.