getRelationship(_:ofDirectoryAt:toItemAt:)
Determines the type of relationship that exists between a directory and an item.
Declaration
func getRelationship(_ outRelationship: UnsafeMutablePointer<FileManager.URLRelationship>, ofDirectoryAt directoryURL: URL, toItemAt otherURL: URL) throwsParameters
- outRelationship:
A pointer to a variable in which to put the relationship between
directoryURLandotherURL. For a list of possible values, see Urlrelationship. - directoryURL:
The URL of the directory that potentially contains the item in
otherURL. The URL in this parameter must specify a directory. This parameter must not benil. - otherURL:
The URL of the file or directory whose relationship to
directoryURLis being tested. This parameter must not benil.
Discussion
Use this method to determine the relationship between an item and a directory whose location you already know. If the relationship between the items is determined successfully, this method sets the value of the outRelationship parameter to an appropriate value. The directory may contain the item, it may be the same as the item, or it may not have a direct relationship to the item.