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

# destinationOfSymbolicLink(atPath:)

Returns the path of the item pointed to by a symbolic link.

## Declaration

```swift
func destinationOfSymbolicLink(atPath path: String) throws -> String
```

## Parameters

- `path`: The path of a file or directory.

## Return Value

Return Value An NSString object containing the path of the directory or file to which the symbolic link path refers. When using Objective-C, returns nil upon failure. If the symbolic link is specified as a relative path, that relative path is returned.

## Discussion

Discussion 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

### Creating symbolic and hard links

- [createSymbolicLink(at:withDestinationURL:)](foundation/filemanager/createsymboliclink(at:withdestinationurl:).md)
- [createSymbolicLink(atPath:withDestinationPath:)](foundation/filemanager/createsymboliclink(atpath:withdestinationpath:).md)
- [linkItem(at:to:)](foundation/filemanager/linkitem(at:to:).md)
- [linkItem(atPath:toPath:)](foundation/filemanager/linkitem(atpath:topath:).md)
