REFACTORING: supporting flag about receiving an offset or not.#722
Merged
headius merged 1 commit intojruby:masterfrom May 10, 2013
Merged
REFACTORING: supporting flag about receiving an offset or not.#722headius merged 1 commit intojruby:masterfrom
headius merged 1 commit intojruby:masterfrom
Conversation
headius
added a commit
that referenced
this pull request
May 10, 2013
REFACTORING: supporting flag about receiving an offset or not.
Member
|
I'll fix the misspelling. Thanks! |
Member
|
So I think what you are trying to do is satisfy the following sentence from the docs of IO.binwrite (http://ruby-doc.org/core-1.9.3/IO.html#method-c-binwrite)
You don't need to inject a boolean as a flag into all of these methods. The way this should be done is just add: file.openFile.setMode(file.openFile.getMode() | ModeFlags.TRUNC);inside of the IO.binwrite method in the right spot and the ChannelDescriptor will just handle the truncation for you. I think we should just revert this commit and retry using the approach above. |
Member
|
So what I said above totally wasn't necessary it was as simple as changing the mode from "wb" to "r+w". See #726. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is important so we can fix all the specs related to write/binwrite. I've tried to make the change in a lot of ways but all of them look very ugly. So I decided to ask feedback from you that know more the code base. @Hedius @enebo
PS: write/binwrite specs need this because ruby doens't truncate the file an offset is given