<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileManager/isDeletableFile(atPath:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileManager(im)isDeletableFileAtPath:"
  },
  "title" : "isDeletableFile(atPath:)"
}
-->

# isDeletableFile(atPath:)

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

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

## Parameters

`path`

A file path.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the current process has delete privileges for the file at `path`; otherwise <doc://com.apple.documentation/documentation/Swift/false> if the process does not have delete privileges or the existence of the file could not be determined.

## 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 <doc://com.apple.documentation/documentation/Swift/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](https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585) in [Secure Coding Guide](https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Introduction.html#//apple_ref/doc/uid/TP40002415).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)