Open ClassFoundation5.9.0
FileManager
class FileManager
Superclasses
class NSObject
The root class of most Foundation class hierarchies.
Citizens in Foundation
Conformances
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol NSObjectProtocol
The
NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
Members
class var `default`: FileManager
var currentDirectoryPath: String
var delegate: FileManagerDelegate?
var homeDirectoryForCurrentUser: URL
var temporaryDirectory: URL
func attributesOfFileSystem(forPath: String
) throws -> [FileAttributeKey : Any] func attributesOfItem(atPath: String
) throws -> [FileAttributeKey : Any] func changeCurrentDirectoryPath(String
) -> Bool func componentsToDisplay(forPath: String
) -> [String]? func contents(atPath: String
) -> Data? func contentsEqual(atPath: String, andPath: String
) -> Bool func contentsOfDirectory(at: URL, includingPropertiesForKeys: [URLResourceKey]?, options: FileManager.DirectoryEnumerationOptions
) throws -> [URL] func contentsOfDirectory(atPath: String
) throws -> [String] Performs a shallow search of the specified directory and returns the paths of any contained items.
func copyItem(at: URL, to: URL
) throws func copyItem(atPath: String, toPath: String
) throws func createDirectory(at: URL, withIntermediateDirectories: Bool, attributes: [FileAttributeKey : Any]?
) throws func createDirectory(atPath: String, withIntermediateDirectories: Bool, attributes: [FileAttributeKey : Any]?
) throws func createFile(atPath: String, contents: Data?, attributes: [FileAttributeKey : Any]?
) -> Bool func createSymbolicLink(at: URL, withDestinationURL: URL
) throws func createSymbolicLink(atPath: String, withDestinationPath: String
) throws func destinationOfSymbolicLink(atPath: String
) throws -> String func displayName(atPath: String
) -> String func enumerator(at: URL, includingPropertiesForKeys: [URLResourceKey]?, options: FileManager.DirectoryEnumerationOptions, errorHandler: ((URL, Error) -> Bool)?
) -> FileManager.DirectoryEnumerator? func enumerator(atPath: String
) -> FileManager.DirectoryEnumerator? func fileExists(atPath: String
) -> Bool func fileExists(atPath: String, isDirectory: UnsafeMutablePointer<ObjCBool>?
) -> Bool func fileSystemRepresentation(withPath: String
) -> UnsafePointer<Int8> func getRelationship(UnsafeMutablePointer
<FileManager.URLRelationship>, of: FileManager.SearchPathDirectory, in: FileManager.SearchPathDomainMask, toItemAt: URL) throws func getRelationship(UnsafeMutablePointer
<FileManager.URLRelationship>, ofDirectoryAt: URL, toItemAt: URL) throws func homeDirectory(forUser: String
) -> URL? func isDeletableFile(atPath: String
) -> Bool func isExecutableFile(atPath: String
) -> Bool func isReadableFile(atPath: String
) -> Bool func isWritableFile(atPath: String
) -> Bool func linkItem(at: URL, to: URL
) throws func linkItem(atPath: String, toPath: String
) throws func mountedVolumeURLs(includingResourceValuesForKeys: [URLResourceKey]?, options: FileManager.VolumeEnumerationOptions
) -> [URL]? Returns an array of URLs that identify the mounted volumes available on the device.
func moveItem(at: URL, to: URL
) throws func moveItem(atPath: String, toPath: String
) throws func removeItem(at: URL
) throws func removeItem(atPath: String
) throws func replaceItem(at: URL, withItemAt: URL, backupItemName: String?, options: FileManager.ItemReplacementOptions
) throws -> URL? func replaceItemAt(URL, withItemAt: URL, backupItemName: String?, options: FileManager.ItemReplacementOptions
) throws -> URL? func setAttributes([FileAttributeKey : Any], ofItemAtPath: String
) throws func string(withFileSystemRepresentation: UnsafePointer<Int8>, length: Int
) -> String func subpaths(atPath: String
) -> [String]? func subpathsOfDirectory(atPath: String
) throws -> [String] Performs a deep enumeration of the specified directory and returns the paths of all of the contained subdirectories.
func url(for: FileManager.SearchPathDirectory, in: FileManager.SearchPathDomainMask, appropriateFor: URL?, create: Bool
) throws -> URL func urls(for: FileManager.SearchPathDirectory, in: FileManager.SearchPathDomainMask
) -> [URL] struct DirectoryEnumerationOptions
class DirectoryEnumerator
struct ItemReplacementOptions
enum SearchPathDirectory
struct SearchPathDomainMask
enum URLRelationship
struct VolumeEnumerationOptions