<!--
{
  "availability" : [
    "macOS: 10.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/getInfoForFile(_:application:type:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWorkspace(im)getInfoForFile:application:type:"
  },
  "title" : "getInfoForFile(_:application:type:)"
}
-->

# getInfoForFile(_:application:type:)

Retrieves information about the specified file.

```
func getInfoForFile(_ fullPath: String, application appName: AutoreleasingUnsafeMutablePointer<NSString?>?, type: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool
```

## Parameters

`fullPath`

The full path to the desired file.

`appName`

The app the system would use to open the file.

`type`

On input, a pointer to a string object variable; on return, if the method is successful, this variable contains a string object with the filename extension or encoded HFS file type of the file.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if this method successfully retrieved the information, or <doc://com.apple.documentation/documentation/Swift/false> if it couldn’t find the file or the app isn’t associated with the file.

## Discussion

You can safely call this method from any thread of your app.

## See Also

[`-  iconForFiles:`](/documentation/AppKit/NSWorkspace/icon(forFiles:))

Returns an image containing the icon for the specified files.

[`-  iconForFile:`](/documentation/AppKit/NSWorkspace/icon(forFile:))

Returns an image containing the icon for the specified file.



---

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)