Browse Source

Merge pull request #17905 from SecTex/sectex/file-helper

Specify `FileAccess` and `FileShare` in `Volo.Abp.IO.FileHelper.ReadAllBytesAsync` method
pull/17915/head
maliming 2 years ago
committed by GitHub
parent
commit
92f65b986e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs

2
framework/src/Volo.Abp.Core/Volo/Abp/IO/FileHelper.cs

@ -69,7 +69,7 @@ public static class FileHelper
/// <returns>A string containing all lines of the file.</returns>
public static async Task<byte[]> ReadAllBytesAsync(string path)
{
using (var stream = File.Open(path, FileMode.Open))
using (var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))
{
var result = new byte[stream.Length];
await stream.ReadAsync(result, 0, (int)stream.Length);

Loading…
Cancel
Save