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

Release any file descriptor associated with this file handler&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
clear();
----

== Description

Release any file descriptor that may be associated with this file handler&period; If `isOpened` and `willCloseOnReset` are both `true`, the file descriptor will be closed, otherwise it will be left unchanged&period; Return 0 on success and a non&hyphen;zero value if the close fails&period; This method succeeds with no effect if `isOpened` was `false`&period; Note that `fileDescriptor` is always `FilesystemUtil&colon;&colon;k&lowbar;INVALID&lowbar;FD` after this call&period;

== Return Value

0 on success, and a non&hyphen;zero value if the close fails


[.small]#Created with https://www.mrdocs.com[MrDocs]#
