I wrote a user-space filesystem caching program for Ford Motor, and one of the problems was trying to delete (cache out) a file in use. The support scripts for the caching program often had to be removed and couldn't.
The error returned by unlink is ETXTBUSY. A workaround is to detect ETXTBUSY on unlink, and move the file up a directory in the tree with link, and then delete the original with unlink. The i-node isn't removed (and this makes the OS happy) but the directory is emptied (and this makes the programmer happy).
In reply to Re: Self Deletion
by clintp
in thread Self Deletion
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |