I've got a directory and a file in it, with the directory marked as read-only:
$ mkdir directoryname
$ touch directoryname/filename
$ chmod a-w directoryname
I cannot delete the file, even if pass the -f flag to rm:
$ rm -f directoryname/filename
rm: cannot remove `directoryname/filename': Permission denied
Is there a way to force rm to delete this file? Obviously, I could temporarily give directoryname write permissions, but I'm looking for a more convenient way.
I believe the underlying unlink syscall fails in the same way. Is there a way to get around that?