[#BloombergLP-bdls-FdStreamBuf_FileHandler-reset]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FdStreamBuf_FileHandler.adoc[FdStreamBuf&lowbar;FileHandler]::reset
:relfileprefix: ../../../
:mrdocs:

Associate this object with the specified `fileDescriptor`, and record the state of the specified `writableFlag` which, if `true`, indicates that the `fileDescriptor` is writable, otherwise it is not&period; Before making this association, if, prior to this call, `willCloseOnReset` is 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` will set `willCloseOnReset`, which, if `true`, indicates that `fileDescriptor` is to be closed when this object is cleared, reset, or destroyed, otherwise no action will be taken on `fileDescriptor` at that time&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 `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]#
