FileManager

class FileManager : NSObject
  • Search for a directory and create it if it does not already exist.

    Throws

    Any error that may be thrown by createDirectory.

    Declaration

    Swift

    func findOrCreateDirectory(at url: URL,
                               withIntermediateDirectories createIntermediates: Bool,
                               attributes: [FileAttributeKey: Any]? = nil) throws

    Parameters

    url

    The URL of the directory to find (or create).

    createIntermediates

    If true then any intermediate directories are also created.

    attributes

    File attributes for the directory, if it is created.