Initializer

init(fileURLWithPath:relativeTo:)

Initializes a newly created file URL referencing the local file or directory at path, relative to a base URL.

Declaration

init(fileURLWithPath path: String, relativeTo base: URL?)

Discussion

If an empty string is used for the path, then the path is assumed to be “.”.

See Also

Creating a File URL

init(fileURLWithPath: String)

Initializes a newly created file URL referencing the local file or directory at path.

init(fileURLWithPath: String, isDirectory: Bool)

Initializes a newly created file URL referencing the local file or directory at path.

init(fileURLWithPath: String, isDirectory: Bool, relativeTo: URL?)

Initializes a newly created file URL referencing the local file or directory at path, relative to a base URL.

init(fileURLWithFileSystemRepresentation: UnsafePointer<Int8>, isDirectory: Bool, relativeTo: URL?)

Initializes a newly created URL referencing the local file or directory at the file system representation of the path.