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

Should shell redirections truncate or append? #377

Closed
vinc opened this issue Aug 4, 2022 · 0 comments · Fixed by #387
Closed

Should shell redirections truncate or append? #377

vinc opened this issue Aug 4, 2022 · 0 comments · Fixed by #387
Assignees
Labels
enhancement New feature or request

Comments

@vinc
Copy link
Owner

vinc commented Aug 4, 2022

Should print foo => /tmp/bar truncate the file or append to its content?

At the moment we do the former and have no way of doing the latter. We could either introduce a print foo =>> /tmp/bar syntax like in Unix to append to the file, or do it by default and require a delete /tmp/bar first to truncate.

In the first case we will need a seek syscall to move the file offset to the end of the file or OpenFlag::Append to avoid the extra syscall.

@vinc vinc added the enhancement New feature or request label Aug 4, 2022
@vinc vinc self-assigned this Aug 4, 2022
@vinc vinc changed the title Should redirections truncate or append? Should shell redirections truncate or append? Aug 4, 2022
@vinc vinc mentioned this issue Aug 13, 2022
@vinc vinc closed this as completed in #387 Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant