Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to read a file already opened in read mode #11

Merged
merged 1 commit into from
Jan 4, 2020

Conversation

TanukiSharp
Copy link
Contributor

I've got those errors when running WorldChunkTool when the chunk0.bin file was already open in read mode: (the <...> are some local path)

System.IO.IOException: The process cannot access the file '<...>\chunk0.bin' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode)
   at WorldChunkTool.Program.ProcessFile(String FileInput) in <...>\WorldChunkTool\WorldChunkTool\Program.cs:line 77
   at WorldChunkTool.Program.Main(String[] args) in <...>\WorldChunkTool\WorldChunkTool\Program.cs:line 62
System.IO.IOException: The process cannot access the file '<...>\chunk0.bin' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode)
   at WorldChunkTool.Chunk.DecompressChunks(String FileInput, Boolean FlagPKGExtraction, Boolean FlagAutoConfirm, Boolean FlagUnpackAll, Boolean FlagPKGDelete) in <...>\WorldChunkTool\WorldChunkTool\Chunk.cs:line 12
   at WorldChunkTool.Program.ProcessFile(String FileInput) in <...>\WorldChunkTool\WorldChunkTool\Program.cs:line 87
   at WorldChunkTool.Program.Main(String[] args) in <...>\WorldChunkTool\WorldChunkTool\Program.cs:line 62

The fix allows to share the file in read mode.

@mhvuze mhvuze merged commit 0df66a0 into mhvuze:master Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants