Skip to content

Commit

Permalink
Request read permissions only
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStolk committed Jan 1, 2024
1 parent a9cb97b commit 058016c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.10.3.0] - 2024-01-02

### Fixed

- Fixed requesting read/write permissions for files when only read permissions are needed.

## [0.10.2.1] - 2024-01-02

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static DecompiledContentFile Read(string contentFilePath)
if (!File.Exists(contentFilePath))
throw new InvalidOperationException("Content file does not exist.");

using FileStream fs = new(contentFilePath, FileMode.Open);
using FileStream fs = new(contentFilePath, FileMode.Open, FileAccess.Read);
using BinaryReader br = new(fs);
ushort tocEntryCount = br.ReadUInt16();

Expand Down
4 changes: 2 additions & 2 deletions src/DevilDaggersInfo.Tools/ContentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public static void Initialize()
new(AssetType.Audio, "jump3"));

ModBinary ddBinary;
using (FileStream fs = new(UserSettings.ResDdPath, FileMode.Open))
using (FileStream fs = new(UserSettings.ResDdPath, FileMode.Open, FileAccess.Read))
ddBinary = new(fs, ddReadFilter);

ModBinary audioBinary;
using (FileStream fs = new(UserSettings.ResAudioPath, FileMode.Open))
using (FileStream fs = new(UserSettings.ResAudioPath, FileMode.Open, FileAccess.Read))
audioBinary = new(fs, audioReadFilter);

Content = new(
Expand Down
2 changes: 1 addition & 1 deletion src/DevilDaggersInfo.Tools/DevilDaggersInfo.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<AssemblyName>ddinfo-tools</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>SA1633</NoWarn>
<Version>0.10.2.0</Version>
<Version>0.10.3.0</Version>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static ModFile FromPath(string filePath)
long fileSize = 0;
try
{
using FileStream fs = new(filePath, FileMode.Open);
using FileStream fs = new(filePath, FileMode.Open, FileAccess.Read);
fileSize = fs.Length;
using BinaryReader reader = new(fs);
ModBinaryToc modBinaryToc = ModBinaryToc.FromReader(reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void LoadEffectiveAssets()

try
{
using FileStream fs = new(filePath, FileMode.Open);
using FileStream fs = new(filePath, FileMode.Open, FileAccess.Read);
using BinaryReader reader = new(fs);
mods.Add(new(ModBinaryToc.FromReader(reader), fileName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void LoadChunks()

try
{
using FileStream fs = new(filePath, FileMode.Open);
using FileStream fs = new(filePath, FileMode.Open, FileAccess.Read);
_modFileSize = fs.Length;
using BinaryReader reader = new(fs);
ModBinaryToc modBinaryToc = ModBinaryToc.FromReader(reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static void ToggleProhibitedAssets(string fileName)
try
{
string path = Path.Combine(UserSettings.ModsDirectory, fileName);
using FileStream fs = new(path, FileMode.Open);
using FileStream fs = new(path, FileMode.Open, FileAccess.Read);
using BinaryReader reader = new(fs);
ModBinaryToc modBinaryToc = ModBinaryToc.FromReader(reader);

Expand Down

0 comments on commit 058016c

Please sign in to comment.