default
TypeScriptstatic get default(): FileManagerSwift declarationclass var `default`: FileManager { get }class · SDK 27.1
class FileManagerstatic get default(): FileManagerSwift declarationclass var `default`: FileManager { get }urlForInAppropriateForCreate(directory: FileManager_SearchPathDirectory, domain: FileManager_SearchPathDomainMask, url: (string) | null, shouldCreate: boolean): stringSwift declarationfunc url(for directory: FileManager.SearchPathDirectory, in domain: FileManager.SearchPathDomainMask, appropriateFor url: URL?, create shouldCreate: Bool) throws -> URLurlForPublishingUbiquitousItemAtExpiration(url: string): { $ret: string; $out: { "outDate": (NSDate) | null } }Swift declarationfunc url(forPublishingUbiquitousItemAt url: URL, expiration outDate: AutoreleasingUnsafeMutablePointer<NSDate?>?) throws -> URLOmit the output parameters from the call. The result contains $ret and $out, with outDate inside $out.
urlForUbiquityContainerIdentifier(containerIdentifier?: (string) | null): (string) | nullSwift declarationfunc url(forUbiquityContainerIdentifier containerIdentifier: String?) -> URL?urls(directory: FileManager_SearchPathDirectory, domainMask: FileManager_SearchPathDomainMask): Array<string>Swift declarationfunc urls(for directory: FileManager.SearchPathDirectory, in domainMask: FileManager.SearchPathDomainMask) -> [URL]attributesOfFileSystem(path: string): NativeMap<FileAttributeKey, unknown>Swift declarationfunc attributesOfFileSystem(forPath path: String) throws -> [FileAttributeKey : Any]attributesOfItem(path: string): NativeMap<FileAttributeKey, unknown>Swift declarationfunc attributesOfItem(atPath path: String) throws -> [FileAttributeKey : Any]changeCurrentDirectoryPath(path: string): booleanSwift declarationfunc changeCurrentDirectoryPath(_ path: String) -> BoolcomponentsToDisplay(path: string): (Array<string>) | nullSwift declarationfunc componentsToDisplay(forPath path: String) -> [String]?containerURL(groupIdentifier: string): (string) | nullSwift declarationfunc containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL?contents(path: string): (ArrayBuffer) | nullSwift declarationfunc contents(atPath path: String) -> Data?contentsEqual(path1: string, path2: string): booleanSwift declarationfunc contentsEqual(atPath path1: String, andPath path2: String) -> BoolcontentsOfDirectoryAtPath(path: string): Array<string>Swift declarationfunc contentsOfDirectory(atPath path: String) throws -> [String]contentsOfDirectoryAtIncludingPropertiesForKeysOptions(url: string, keys?: (Array<URLResourceKey>) | null, mask?: FileManager_DirectoryEnumerationOptions): Array<string>Swift declarationfunc contentsOfDirectory(at url: URL, includingPropertiesForKeys keys: [URLResourceKey]?, options mask: FileManager.DirectoryEnumerationOptions = []) throws -> [URL]copyItemAtPathToPath(srcPath: string, dstPath: string): voidSwift declarationfunc copyItem(atPath srcPath: String, toPath dstPath: String) throwscopyItemAtTo(srcURL: string, dstURL: string): voidSwift declarationfunc copyItem(at srcURL: URL, to dstURL: URL) throwscreateDirectoryAtPathWithIntermediateDirectoriesAttributes(path: string, createIntermediates: boolean, attributes?: (NativeMap<FileAttributeKey, unknown>) | null): voidSwift declarationfunc createDirectory(atPath path: String, withIntermediateDirectories createIntermediates: Bool, attributes: [FileAttributeKey : Any]? = nil) throwscreateDirectoryAtWithIntermediateDirectoriesAttributes(url: string, createIntermediates: boolean, attributes?: (NativeMap<FileAttributeKey, unknown>) | null): voidSwift declarationfunc createDirectory(at url: URL, withIntermediateDirectories createIntermediates: Bool, attributes: [FileAttributeKey : Any]? = nil) throwscreateFile(path: string, data?: (ArrayBuffer) | null, attr?: (NativeMap<FileAttributeKey, unknown>) | null): booleanSwift declarationfunc createFile(atPath path: String, contents data: Data?, attributes attr: [FileAttributeKey : Any]? = nil) -> BoolcreateSymbolicLinkAtPathWithDestinationPath(path: string, destPath: string): voidSwift declarationfunc createSymbolicLink(atPath path: String, withDestinationPath destPath: String) throwscreateSymbolicLinkAtWithDestinationURL(url: string, destURL: string): voidSwift declarationfunc createSymbolicLink(at url: URL, withDestinationURL destURL: URL) throwsdestinationOfSymbolicLink(path: string): stringSwift declarationfunc destinationOfSymbolicLink(atPath path: String) throws -> StringdisplayName(path: string): stringSwift declarationfunc displayName(atPath path: String) -> StringenumeratorAtPath(path: string): (FileManager_DirectoryEnumerator) | nullSwift declarationfunc enumerator(atPath path: String) -> FileManager.DirectoryEnumerator?evictUbiquitousItem(url: string): voidSwift declarationfunc evictUbiquitousItem(at url: URL) throwsfetchLatestRemoteVersionOfItem(url: string, completionHandler: ((arg0: (NSFileVersion) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc fetchLatestRemoteVersionOfItem(at url: URL) async throws -> NSFileVersionfileExistsAtPath(path: string): booleanSwift declarationfunc fileExists(atPath path: String) -> BoolfileExistsAtPathIsDirectory(path: string): { $ret: boolean; $out: { "isDirectory": boolean } }Swift declarationfunc fileExists(atPath path: String, isDirectory: UnsafeMutablePointer<ObjCBool>?) -> BoolOmit the output parameters from the call. The result contains $ret and $out, with isDirectory inside $out.
fileSystemRepresentation(path: string): SDKHandleSwift declarationfunc fileSystemRepresentation(withPath path: String) -> UnsafePointer<CChar>getFileProviderServicesForItem(url: string, completionHandler: ((arg0: (NativeMap<NSFileProviderServiceName, NSFileProviderService>) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc fileProviderServicesForItem(at url: URL) async throws -> [NSFileProviderServiceName : NSFileProviderService]getRelationshipOfInToItemAt(outRelationship: SDKHandle, directory: FileManager_SearchPathDirectory, domainMask: FileManager_SearchPathDomainMask, url: string): voidSwift declarationfunc getRelationship(_ outRelationship: UnsafeMutablePointer<FileManager.URLRelationship>, of directory: FileManager.SearchPathDirectory, in domainMask: FileManager.SearchPathDomainMask, toItemAt url: URL) throwsgetRelationshipOfDirectoryAtToItemAt(outRelationship: SDKHandle, directoryURL: string, otherURL: string): voidSwift declarationfunc getRelationship(_ outRelationship: UnsafeMutablePointer<FileManager.URLRelationship>, ofDirectoryAt directoryURL: URL, toItemAt otherURL: URL) throwsstatic init(): FileManagerSwift declarationinit()isDeletableFile(path: string): booleanSwift declarationfunc isDeletableFile(atPath path: String) -> BoolisExecutableFile(path: string): booleanSwift declarationfunc isExecutableFile(atPath path: String) -> BoolisReadableFile(path: string): booleanSwift declarationfunc isReadableFile(atPath path: String) -> BoolisUbiquitousItem(url: string): booleanSwift declarationfunc isUbiquitousItem(at url: URL) -> BoolisWritableFile(path: string): booleanSwift declarationfunc isWritableFile(atPath path: String) -> BoollinkItemAtPathToPath(srcPath: string, dstPath: string): voidSwift declarationfunc linkItem(atPath srcPath: String, toPath dstPath: String) throwslinkItemAtTo(srcURL: string, dstURL: string): voidSwift declarationfunc linkItem(at srcURL: URL, to dstURL: URL) throwsmountedVolumeURLs(propertyKeys?: (Array<URLResourceKey>) | null, options?: FileManager_VolumeEnumerationOptions): (Array<string>) | nullSwift declarationfunc mountedVolumeURLs(includingResourceValuesForKeys propertyKeys: [URLResourceKey]?, options: FileManager.VolumeEnumerationOptions = []) -> [URL]?moveItemAtPathToPath(srcPath: string, dstPath: string): voidSwift declarationfunc moveItem(atPath srcPath: String, toPath dstPath: String) throwsmoveItemAtTo(srcURL: string, dstURL: string): voidSwift declarationfunc moveItem(at srcURL: URL, to dstURL: URL) throwspauseSyncForUbiquitousItem(url: string, completionHandler: ((arg0: (NativeError) | null) => void)): voidSwift declarationfunc pauseSyncForUbiquitousItem(at url: URL) async throwsremoveItemAtPath(path: string): voidSwift declarationfunc removeItem(atPath path: String) throwsremoveItemAt(URL: string): voidSwift declarationfunc removeItem(at URL: URL) throwsreplaceItem(originalItemURL: string, newItemURL: string, backupItemName?: (string) | null, options?: FileManager_ItemReplacementOptions): { $ret: null; $out: { "resultingURL": (NSURL) | null } }Swift declarationfunc replaceItem(at originalItemURL: URL, withItemAt newItemURL: URL, backupItemName: String?, options: FileManager.ItemReplacementOptions = [], resultingItemURL resultingURL: AutoreleasingUnsafeMutablePointer<NSURL?>?) throwsOmit the output parameters from the call. The result contains $ret and $out, with resultingURL inside $out.
resumeSyncForUbiquitousItem(url: string, behavior: NSFileManagerResumeSyncBehavior, completionHandler: ((arg0: (NativeError) | null) => void)): voidSwift declarationfunc resumeSyncForUbiquitousItem(at url: URL, with behavior: NSFileManagerResumeSyncBehavior) async throwssetAttributes(attributes: NativeMap<FileAttributeKey, unknown>, path: string): voidSwift declarationfunc setAttributes(_ attributes: [FileAttributeKey : Any], ofItemAtPath path: String) throwssetUbiquitous(flag: boolean, url: string, destinationURL: string): voidSwift declarationfunc setUbiquitous(_ flag: Bool, itemAt url: URL, destinationURL: URL) throwsstartDownloadingUbiquitousItem(url: string): voidSwift declarationfunc startDownloadingUbiquitousItem(at url: URL) throwsstring(str: SDKHandle, len: number): stringSwift declarationfunc string(withFileSystemRepresentation str: UnsafePointer<CChar>, length len: Int) -> Stringsubpaths(path: string): (Array<string>) | nullSwift declarationfunc subpaths(atPath path: String) -> [String]?subpathsOfDirectory(path: string): Array<string>Swift declarationfunc subpathsOfDirectory(atPath path: String) throws -> [String]trashItem(url: string): { $ret: null; $out: { "outResultingURL": (NSURL) | null } }Swift declarationfunc trashItem(at url: URL, resultingItemURL outResultingURL: AutoreleasingUnsafeMutablePointer<NSURL?>?) throwsOmit the output parameters from the call. The result contains $ret and $out, with outResultingURL inside $out.
uploadLocalVersionOfUbiquitousItem(url: string, conflictResolutionPolicy: NSFileManagerUploadLocalVersionConflictPolicy, completionHandler: ((arg0: (NSFileVersion) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc uploadLocalVersionOfUbiquitousItem(at url: URL, withConflictResolutionPolicy conflictResolutionPolicy: NSFileManagerUploadLocalVersionConflictPolicy) async throws -> NSFileVersionget currentDirectoryPath(): stringSwift declarationvar currentDirectoryPath: String { get }get delegate(): (SDKHandle) | nullSwift declarationunowned(unsafe) var delegate: (any FileManagerDelegate)? { get set }set delegate(value: (Implements<FileManagerDelegate> | SDKHandle) | null)Swift declarationunowned(unsafe) var delegate: (any FileManagerDelegate)? { get set }get temporaryDirectory(): stringSwift declarationvar temporaryDirectory: URL { get }get ubiquityIdentityToken(): ((SDKHandle) & (SDKHandle) & (SDKHandle)) | nullSwift declaration@NSCopying var ubiquityIdentityToken: (any NSCoding & NSCopying & NSObjectProtocol)? { get }enumeratorAtIncludingPropertiesForKeysOptions(url: string, keys?: (Array<URLResourceKey>) | null, mask?: FileManager_DirectoryEnumerationOptions): (FileManager_DirectoryEnumerator) | nullSwift declaration@nonobjc func enumerator(at url: URL, includingPropertiesForKeys keys: [URLResourceKey]?, options mask: FileManager.DirectoryEnumerationOptions = [], errorHandler handler: ((URL, any Error) -> Bool)? = nil) -> FileManager.DirectoryEnumerator?Returns a directory enumerator object that can be used to perform a deep enumeration of the directory at the specified URL. Because the enumeration is deep — that is, it lists the contents of all subdirectories — this enumerator object is useful for performing actions that involve large file-system subtrees. If the method is passed a directory on which another file system is mounted (a mount point), it traverses the mount point. This method does not resolve symbolic links or mount points encountered in the enumeration process, nor does it recurse through them if they point to a directory. The ``FileManager/DirectoryEnumerator`` class has methods for skipping descendants of the existing path and for returning the number of levels deep the current object is in the directory hierarchy being enumerated (where the directory passed to this method is considered to be level 0). - Parameters: - url: The location of the directory for which you want an enumeration. This URL must not be a symbolic link that points to the desired directory. - keys: An array of keys that identify the properties that you want pre-fetched for each item in the enumeration. You may specify `nil`. - mask: Options for the enumeration. - handler: An optional error handler block for the file manager to call when an error occurs. The handler block should return `true` if you want the enumeration to continue or `false` if you want it to stop. - Returns: A directory enumerator object that enumerates the contents of the directory at `url`. If `url` is a filename, the method returns an enumerator object that enumerates no files — the first call to `nextObject()` returns `nil`.
replaceItemAt(originalItemURL: string, newItemURL: string, backupItemName?: (string) | null, options?: FileManager_ItemReplacementOptions): (string) | nullSwift declarationfunc replaceItemAt(_ originalItemURL: URL, withItemAt newItemURL: URL, backupItemName: String? = nil, options: FileManager.ItemReplacementOptions = []) throws -> URL?Replaces the contents of the item at the specified URL in a manner that ensures no data loss occurs. By default, the creation date, permissions, Finder label and color, and Spotlight comments of the original item are preserved on the new item. You can configure which metadata is preserved using the `options` parameter. This method works only when the `originalItemURL` and `newItemURL` parameters are located on the same volume. Attempting to call this method by passing parameters that have locations on different volumes results in an error. - Parameters: - originalItemURL: The item containing the content you want to replace. - newItemURL: The item containing the new content for `originalItemURL`. It is recommended that you put this item in a temporary directory as provided by the OS. - backupItemName: If provided, the name used to create a backup of the original item. The backup is placed in the same directory as the original item. - options: The options to use during the replacement. Typically, you pass ``FileManager/ItemReplacementOptions/usingNewMetadataOnly``. - Returns: The URL of the new item. If no new file system object is required, the URL object may be the same passed to `originalItemURL`.
replaceItemAtURL(originalItemURL: NSURL, newItemURL: NSURL, backupItemName?: (string) | null, options?: FileManager_ItemReplacementOptions): (NSURL) | nullSwift declarationfunc replaceItemAtURL(originalItemURL: NSURL, withItemAtURL newItemURL: NSURL, backupItemName: String? = nil, options: FileManager.ItemReplacementOptions = []) throws -> NSURL?Replaces the contents of the item at the specified URL in a manner that ensures no data loss occurs. @DeprecationSummary { Use ``replaceItemAt(_:withItemAt:backupItemName:options:)-4210g`` instead. } - Parameters: - originalItemURL: The item containing the content you want to replace. - newItemURL: The item containing the new content for `originalItemURL`. - backupItemName: If provided, the name used to create a backup of the original item. - options: The options to use during the replacement. - Returns: The URL of the new item, or `nil`.
No declarations were skipped in this snapshot.