Initializer

init(fileDescriptor:closeOnDealloc:)

Initializes and returns a file handle object associated with the specified file descriptor and deallocation policy.

Declaration

init(fileDescriptor fd: Int32, closeOnDealloc closeopt: Bool)

Parameters

fileDescriptor

The POSIX file descriptor with which to initialize the file handle.

flag

true if the returned file handle object should take ownership of the file descriptor and close it for you or false if you want to maintain ownership of the file descriptor.

Return Value

An initialized file handle object.

Discussion

If flag is false, the file descriptor you pass in to this method is not owned by the file handle object. In such a case, you are responsible for closing the file descriptor at some point after disposing of the file handle object. If you want the file handle object to close the descriptor for you automatically, pass true for the flag parameter.

See Also

Creating a File Handle

init(fileDescriptor: Int32)

Initializes and returns a file handle object associated with the specified file descriptor.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software