[#BloombergLP-bdls-FdStreamBuf-reset] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FdStreamBuf.adoc[FdStreamBuf]::reset :relfileprefix: ../../../ :mrdocs: Associate this object with the specified `fileDescriptor`, and record the state of the specified `writableFlag` which, if `true`, indicates that `fileDescriptor` is writable, otherwise it is not. If, in the call to the constructor or `reset` prior to this call, `willCloseOnReset` was true, close any file descriptor previously associated with this object, otherwise leave it open but disassociate this object from it. The Optionally specified `willCloseOnResetFlag` which will set `willCloseOnReset`, which, if `true`, indicates that the specified file descriptor is to be closed when this object is later cleared, reset, or destroyed, otherwise no action will be taken on `fileDescriptor` at that time. The supplied file descriptor, if valid, should remain open until the next call to either `reset` or the destructor, regardless of the value of `willCloseOnResetFlag`. Optionally specify a `binaryModeFlag`, which is ignored on Unix; if `false` on Windows, it indicates that ` `s internally are to be translated to and from `\r ` sequences on the device; on Unix or if `binaryModeFlag` is `true` no such translation is to occur. Return 0 on success, and a non‐zero value otherwise. Note that if `FilesystemUtil::k_INVALID_FD` is passed as `fileDescriptor`, no file descriptor is to be associated with this object. Also note that the state of the `fileDescriptor` is unchanged by this call, there is no implicit seek. == Synopsis Declared in `<bdls_fdstreambuf.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int reset( xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FilesystemUtil::FileDescriptor] fileDescriptor, bool writableFlag, bool willCloseOnResetFlag = true, bool binaryModeFlag = false); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#