[#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&period; 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&period; 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&period; 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`&period; Optionally specify a `binaryModeFlag`, which is ignored on Unix&semi; if `false` on Windows, it indicates that &grave;
&grave;s internally are to be translated to and from &grave;&bsol;r
&grave; sequences on the device&semi; on Unix or if `binaryModeFlag` is `true` no such translation is to occur&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; Note that if `FilesystemUtil&colon;&colon;k&lowbar;INVALID&lowbar;FD` is passed as `fileDescriptor`, no file descriptor is to be associated with this object&period; Also note that the state of the `fileDescriptor` is unchanged by this call, there is no implicit seek&period;

== Synopsis

Declared in `&lt;bdls&lowbar;fdstreambuf&period;h&gt;`

[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]#
