Contents

init(fileDescriptor:closeOnDealloc:)

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

Declaration

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

Parameters

  • fd:

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

  • closeopt:

    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 isn’t owned by the file handle object. In such a case, you’re 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

Related Documentation

Creating a File Handle