FileManager
class FileManager : NSObject
-
Mechanica
Cleans all contents in a directory
path.Throws
throws an error in cases of failure.Declaration
Swift
public final func cleanDirectory(atPath path: String) throwsParameters
pathdirectory path (if it’s not a directory path, nothing is done).
-
Mechanica
Delete a file or a directory at a given
path.Throws
throws an error in cases of failure.Declaration
Swift
public final func deleteFileOrDirectory(atPath path: String) throwsParameters
pathdirectory or file path.
-
Mechanica
Creates and returns always a
newdirectory in Library/Caches in the user’s home directory for discardable cache files.Declaration
Swift
public final func newCachesSubDirectory(in domain: FileManager.SearchPathDomainMask = .userDomainMask, withName name: String = UUID().uuidString) throws -> URL
FileManager Extension Reference