moros icon indicating copy to clipboard operation
moros copied to clipboard

Should shell redirections truncate or append?

Open vinc opened this issue 3 years ago • 0 comments

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 avatar Aug 04 '22 06:08 vinc