moros
moros copied to clipboard
Should shell redirections truncate or append?
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.