[#BloombergLP-bdls-FilesystemUtil-remove-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::remove
:relfileprefix: ../../../
:mrdocs:

`remove` overloads

== Synopses

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

Remove the file or directory at the specified `path`&period; If the `path` refers to a directory and the optionally specified `recursiveFlag` is `true`, recursively remove all files and directories within the specified directory before removing the directory itself&period; Return 0 on success and a non&hyphen;zero value otherwise&period; If `path` refers to a symbolic link, the symbolic link will be removed, not the target of the link&period; Note that if `path` is a directory, and the directory is not empty, and recursive is `false`, this method will fail&period; Also note that if the function fails when `recursive` is `true`, it may or may not have removed _some_ files or directories before failing&period; Also note that if `remove` is called on &quot;&period;&quot; or &quot;&period;&period;&quot;, it will fail with no effect&period; The parameterized `STRING&lowbar;TYPE` must be one of `bsl&colon;&colon;string`, `std&colon;&colon;string`, `std&colon;&colon;pmr&colon;&colon;string` (if supported), `bsl&colon;&colon;string&lowbar;view`, or `bslstl&colon;&colon;StringRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/bdls/FilesystemUtil/remove-07.adoc[remove](
    char const* path,
    bool recursiveFlag = false);
----

[.small]#xref:BloombergLP/bdls/FilesystemUtil/remove-07.adoc[_» more&period;&period;&period;_]#

Same as `remove(const char &ast;, bool)`, but accepts a `STRING&lowbar;TYPE` path&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class STRING&lowbar;TYPE&gt;
static
int
xref:BloombergLP/bdls/FilesystemUtil/remove-0c.adoc[remove](
    STRING&lowbar;TYPE const& path,
    bool recursiveFlag = false);
----

[.small]#xref:BloombergLP/bdls/FilesystemUtil/remove-0c.adoc[_» more&period;&period;&period;_]#


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