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

fs: expose getdelim() functionality through fd.read() #118

Merged
merged 1 commit into from
Oct 18, 2022
Merged

Conversation

jow-
Copy link
Owner

@jow- jow- commented Oct 18, 2022

When fd.read() is invoked with a single-character string argument, invoke getdelim() internally to read the input until the give character or EOF. This is useful for reading character delimited input data.

For example fd.read('\n') will read any data up to the first newline (or EOF) while fd.read('\0x00') will read until the first null byte.

Signed-off-by: Jo-Philipp Wich [email protected]

When `fd.read()` is invoked with a single-character string argument,
invoke `getdelim()` internally to read the input until the give character
or EOF. This is useful for reading character delimited input data.

For example `fd.read('\n')` will read any data up to the first newline
(or EOF) while `fd.read('\0x00')` will read until the first null byte.

Signed-off-by: Jo-Philipp Wich <[email protected]>
@jow- jow- merged commit 9a882f4 into master Oct 18, 2022
@jow- jow- deleted the fs-read-getdelim branch October 18, 2022 07:52
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.

1 participant