7 ms·
Would that work? The fs may actually allocate a new file before deleting the exisiting allocation so the risk of it not working is still there I would think?
by kiwijamo 6y ago
Would that work? The fs may actually allocate a new file before deleting the exisiting allocation so the risk of it not working is still there I would think?
- quesera 6y agoIt might vary by kernel, filesystem, or shell, but in my experience and confirmed with a quick test: shell redirection does not create a new file/inode.
- geocrasher 6y agoWorst case scenario, if > filename didn't null it, then just echo "0" > filename