---
title: "isDeletableFile(atPath:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/filemanager/isdeletablefile(atpath:)"
---

# isDeletableFile(atPath:)

Returns a Boolean value that indicates whether the invoking object appears able to delete a specified file.

## Declaration

```swift
func isDeletableFile(atPath path: String) -> Bool
```

## Parameters

- `path`: A file path.

## Return Value

Return Value true if the current process has delete privileges for the file at path; otherwise false if the process does not have delete privileges or the existence of the file could not be determined.

## Discussion

Discussion For a directory or file to be deletable, the current process must either be able to write to the parent directory of path or it must have the same owner as the item at path. If path is a directory, every item contained in path must be deletable by the current process. If the file at path is inaccessible to your app, perhaps because it does not have search privileges for one or more parent directories, this method returns false. If the item at path is a symbolic link, it is not traversed. note: Attempting to predicate behavior based on the current state of the file system or a particular file on the file system is not recommended. Doing so can cause odd behavior or race conditions. It’s far better to attempt an operation (such as loading a file or creating a directory), check for errors, and handle those errors gracefully than it is to try to figure out ahead of time whether the operation will succeed. For more information on file system race conditions, see Race Conditions and Secure File Operations in Secure Coding Guide.

## See Also

### Determining access to files

- [fileExists(atPath:)](foundation/filemanager/fileexists(atpath:).md)
- [fileExists(atPath:isDirectory:)](foundation/filemanager/fileexists(atpath:isdirectory:).md)
- [isReadableFile(atPath:)](foundation/filemanager/isreadablefile(atpath:).md)
- [isWritableFile(atPath:)](foundation/filemanager/iswritablefile(atpath:).md)
- [isExecutableFile(atPath:)](foundation/filemanager/isexecutablefile(atpath:).md)
