-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
Is the following:
FileCache/src/FileCache/FileCache.cs
Lines 713 to 714 in 6f9b86c
| //write the object payload (lock the file so we can write to it and force others to wait for us to finish) | |
| using (FileStream stream = GetStream(cachedItemPath, FileMode.Create, FileAccess.Write)) |
Meant to have a true argument?
//write the object payload (lock the file so we can write to it and force others to wait for us to finish)
using (FileStream stream = GetStream(cachedItemPath, FileMode.Create, FileAccess.Write, true))Correct me if i'm wrong, but at present, it seems like multiple threads/processes can write to a file at the same time. Additionally, if a thread attempts to read from the file while it is being written to, a partial read of the file can occur.
Same goes for:
FileCache/src/FileCache/FileCache.cs
Lines 725 to 726 in 6f9b86c
| //write the cache policy | |
| using (FileStream stream = GetStream(cachedPolicy, FileMode.Create, FileAccess.Write)) |
Edit: Minor edits to phrasing
Metadata
Metadata
Assignees
Labels
No labels