CFURLGetFileSystemRepresentation(_:_:_:_:)
Fills a buffer with the file system’s native string representation of a given URL’s path.
Declaration
func CFURLGetFileSystemRepresentation(_ url: CFURL!, _ resolveAgainstBase: Bool, _ buffer: UnsafeMutablePointer<UInt8>!, _ maxBufLen: CFIndex) -> BoolParameters
- url:
The
CFURLobject whose native file system representation you want to obtain. - resolveAgainstBase:
Pass
trueto return an absolute path name. - buffer:
A pointer to a character buffer. On return, the buffer holds the native file system’s representation of
url. The buffer is null-terminated. This parameter must be at leastmaxBufLenin size for the file system in question to avoid failures for insufficiently large buffers. - maxBufLen:
The maximum number of characters that can be written to
buffer.
Return Value
true if successful, false if an error occurred.
Discussion
No more than maxBufLen bytes are written to buffer. If url requires more than maxBufLen bytes to represent itself, including the terminating null byte, this function returns false. To avoid this possible failure, you should pass a buffer with size of at least the maximum path length for the file system in question.