[#BloombergLP-bdls-FdStreamBuf-2constructor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FdStreamBuf.adoc[FdStreamBuf]::FdStreamBuf :relfileprefix: ../../../ :mrdocs: Create a `FdStreamBuf` associated with the specified `fileDescriptor` that refers to an already opened file or device, and specify `writableFlag` which, if `true`, indicates that `fileDescriptor` is writable, otherwise it is not. The optionally specified `willCloseOnResetFlag`, if `true`, indicates that `fileDescriptor` is to be closed the next time this object is reset, cleared or destroyed, or if `false` the file descriptor is to be left open. Optionally specify a `binaryModeFlag` which is ignored on Unix; if `false` on Windows, it indicates that ` `s are to be translated to and from `\r ` sequences on the device. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The supplied file descriptor, if valid, should remain open until the next call to either `reset` or the destructor. Note that if `FilesystemUtil::k_INVALID_FD` is passed to `fileDescriptor`, no file descriptor is to be associated with this object. Also note that the state of the `fileDescriptor` is unchanged by this call (i.e., there is no implicit seek). == Synopsis Declared in `<bdls_fdstreambuf.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit FdStreamBuf( xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FilesystemUtil::FileDescriptor] fileDescriptor, bool writableFlag, bool willCloseOnResetFlag = true, bool binaryModeFlag = false, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#