@Override
	public int unlink(String path) throws FuseException {
		if (fileSystem.isReadOnly())
			return Errno.EROFS;
		try {
			if (DirectoryInfo.class.isInstance(fileSystem.getFileMetaData(path)))
				return rmdir(path);
		} catch (PathNotFoundException e) {
			return Errno.ENOENT;
		}
		try {
			fileSystem.deleteFile(path);
		} catch (AccessDeniedException e) {
			return Errno.EACCES;
		} catch (PathNotFoundException e) {
			return Errno.EINVAL;
		}
		return 0;
	}