Skip to content

Commit

Permalink
Changed file access parameters for hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanlynn committed Aug 4, 2024
1 parent 3dd2ad5 commit 9913291
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BackupFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private static string _BytesToString(byte[] Bytes) {
}
public static string GetFileHash(string Path, HashAlgorithm HashAlgorithm) {
byte[] bytes;
using (FileStream fs = new(Path, FileMode.Open))
using (FileStream fs = new(Path, FileMode.Open, FileAccess.Read, FileShare.Read))
bytes = HashAlgorithm.ComputeHash(fs);
return _BytesToString(bytes);
}
Expand Down

0 comments on commit 9913291

Please sign in to comment.