FIX: for removing files, check write access in the directory, not the
file