| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
* Are the docs fine? They're basically copied from [the man page](https://man7.org/linux/man-pages/man2/lseek.2.html).
I'd like to avoid just copying the text like this; could you instead either write your own text, or make it a quote with a citation?
And actually, looking at the text, I'm having trouble parsing "Sets the offset to next location in the file greater than or equal to the specified number of bytes that contains data." Would it be correct to rephrase it along the lines of "seeks forward from the current position by the specified number of bytes, and then if that's in a hole, seeks forward until it reaches data" or so?
* Should the `staged_api` attribute and other aspects be used? I'm not sure what their purpose is but I included it just in case.
Those are there because that file is derived from a file in std, and it's easier to keep up to date if we keep the diffs minimal. For these new values, we don't need to add them.
Sorry, something went wrong.
Yes, I think this would be much clearer. My only concern is if it's preferable that the wording of the documentation remain consistent across SeekFrom variants? |
Sorry, something went wrong.
|
How about, "Sets the offset to the current position plus the specified number of bytes, plus the distance to the next byte which is not in a hole."? |
Sorry, something went wrong.
|
The change here looks good to me. That said, it looks like this change needs a semver bump, because users using std::io::SeekFrom will need to switch to rustix's. I'm hoping to avoid doing a semver bump in rustix for a while. If you'd like this feature to show up in a release sooner, what would you think of renaming seek to seek_ext or something, and re-introducing the old seek that takes a std::io::SeekFrom, so that it's semver-compatible? |
Sorry, something went wrong.
|
I'm not pressed for this feature currently, I just was interested in its absence in the API. My use for it is in an experimental PR which will not be merged soon, if ever. This should probably be placed in some kind of 0.37 milestone or something. |
Sorry, something went wrong.
|
Sounds good. I've now added a 0.37 label and labelled this PR with it. |
Sorry, something went wrong.
|
#487 landed, which will need a semver bump, so let's land this too. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #480
Adds two new variants to the SeekFrom API, Data and Hole.
Some questions: