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 directorynameI cannot delete the file, even if pass the -f flag to rm:$ rm -f directoryname/filenamerm: cannot remove `directoryname/filename': Permission deniedIs 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?
How do I delete a file in a read-only directory?
files;permissions;rm