>>I think there is no need to explicitly check whether the directory >>is writable. What would be the purpose of that? > > > I didn't write that patch, but I guess there could be a purpose for it. > Namely it could help deleting a file in vain. If there are Filesystems > that let you delete a writable file even though you can't create new > ones in a non-writable dir, then without those lines, emacs would delete > an old backup only to find out that it can't create a new one. > > Most likely these would be cases where the old backup file was writable, > so if you had some logic to write to existing files and only delete them > if they are not writable, then the check whether the directory is > writable should really be superfluous. Otherwise I'm not so sure. Wouldn't it be simpler to try something like the attached patch.