This repository was archived by the owner on May 4, 2018. It is now read-only.
Added uv_fs_req_result method#1307
Open
gigi81 wants to merge 4 commits intojoyent:masterfrom
gigi81:master
Open
Added uv_fs_req_result method#1307gigi81 wants to merge 4 commits intojoyent:masterfrom gigi81:master
gigi81 wants to merge 4 commits intojoyent:masterfrom
gigi81:master
Conversation
Added uv_fs_req_result method useful for binding libraries
Contributor
|
Hum. This would make life of ffi users easy, since we have https://github.com/joyent/libuv/blob/master/include/uv.h#L554 to get the size. However, there are other fields on that structure which are also needed on different fs operations. @indutny how do you feel about this? Should we add a one-liner for each meaningful structure member here? |
|
Would be quite a lot of functions, but, it would make FFI functions independent of any struct change. I am personally for this, because currently my binding code looks ugly as hell, with hardcoded offsets and such. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 single commit of the pull request #1306.
I added this method because it makes easier and safer on a c# libuv binding library to get the result of an fs request on a callback. Without this method I would have to replicate and then marshal the entire uv_fs_t structure. This is prone to errors and difficult to maintain: if you ever change the internals of uv_fs_t my library will break. As long as it's a really small change in libuv, can you please consider to merge this patch? I'm pretty much sure this will come useful to other binding libraries. Thanks