4 ms·
Sed will write to read-only files
- lsc 11y ago>This is not a bug, but rather a consequence of how the Unix filesystem works. Yeah. this is something that really confuses new UNIX users. But it has absolutely nothing to do with sed. If you have write-access to a directory, you can delete any file in that directory. You can also create a new file in that directory with the same name as the old file. So write-permission on a directory is a bit like write-permission on everything beneath that directory. The exception is the sticky bit... /tmp directories are traditionally 1777, meaning all can read, write and traverse, but the 1, the 'sticky bit' means that you can't delete or overwrite files you don't own. With the sticky bit set, the directory functions the way most non-UNIX users expect; e.g. if I create a file and make it writable only to me, nobody else can overwrite it.