---
title: "attributesOfFileSystem(forPath:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/filemanager/attributesoffilesystem(forpath:)"
---

# attributesOfFileSystem(forPath:)

Returns a dictionary that describes the attributes of the mounted file system on which a given path resides.

## Declaration

```swift
func attributesOfFileSystem(forPath path: String) throws -> [FileAttributeKey : Any]
```

## Parameters

- `path`: Any pathname within the mounted file system.

## Mentioned in

About Apple File System

## Return Value

Return Value A dictionary object that describes the attributes of the mounted file system on which path resides. See File-System Attribute Keys for a description of the keys available in the dictionary.

## Discussion

Discussion This method does not traverse a terminal symbolic link. note: In Swift, this method returns a nonoptional result and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Getting and setting attributes

- [componentsToDisplay(forPath:)](foundation/filemanager/componentstodisplay(forpath:).md)
- [displayName(atPath:)](foundation/filemanager/displayname(atpath:).md)
- [attributesOfItem(atPath:)](foundation/filemanager/attributesofitem(atpath:).md)
- [setAttributes(_:ofItemAtPath:)](foundation/filemanager/setattributes(_:ofitematpath:).md)
