-
Notifications
You must be signed in to change notification settings - Fork 115
v2 fix #1409: работа ЧтенияДанных из ДвоичныхДанных большого размера #1507
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
Conversation
WalkthroughThis pull request modifies two components in the OneScript Standard Library. In the Changes
Sequence Diagram(s)sequenceDiagram
participant C as Caller
participant B as BackingTemporaryFile
participant FS as File System
C->>B: Call OpenReadStream()
B->>FS: Open file stream with FileShare.Delete
FS-->>B: Return file stream
B-->>C: Return stream
sequenceDiagram
participant Client as Caller
participant D as DataReader
Client->>D: Invoke Constructor(dataSource, ...)
D->>D: Evaluate dataSource with switch expression
D-->>Client: Return DataReader instance with assigned stream
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/OneScript.StandardLibrary/Binary/DataReader.cs (1)
76-76: Add FileShare.Delete to FileStream for consistency.For consistency with the changes in
BackingTemporaryFile, consider addingFileShare.Deleteto prevent potential file access conflicts.- stream = new FileStream(dataSource.AsString(), FileMode.Open, FileAccess.Read, FileShare.Read); + stream = new FileStream(dataSource.AsString(), FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/OneScript.StandardLibrary/Binary/BackingTemporaryFile.cs(1 hunks)src/OneScript.StandardLibrary/Binary/DataReader.cs(1 hunks)
🔇 Additional comments (2)
src/OneScript.StandardLibrary/Binary/BackingTemporaryFile.cs (1)
59-59: LGTM! This change resolves the file access conflict.The addition of
FileShare.Deleteto the file sharing options allows the temporary file to be deleted even while it's being read, preventing the "file in use" IOException mentioned in the PR description.src/OneScript.StandardLibrary/Binary/DataReader.cs (1)
73-89: LGTM! Code refactoring improves readability.The switch expression provides a more concise and maintainable way to handle different data source types, while the broader scope for the stream variable reduces code duplication.
Ранее падало на
Внешнее исключение (System.IO.IOException): The process cannot access the file 'tmpE038.tmp' because it is being used by another process.
Причину см.: dotnet/runtime#91484 (comment)
Summary by CodeRabbit