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

`move` overloads

== Synopses

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

Move the file or directory at the specified `oldPath` to the specified `newPath`&period; On Windows, this operation occurs in two steps&colon; first, if there is a regular file or file symbolic link at `newPath`, it is removed&semi; if there is a directory or directory symbolic link at `newPath`, this function fails with no effect&period; Second, the file or directory at `oldPath` is actually moved&semi; this operation fails with no further effect if the source and destination are on different volumes or if the source does not exist (including in the case where `oldPath` and `newPath` are the same path)&period; On Unix, the operation is always atomic, with the file or directory at `newPath` being replaced by the item at `oldPath`&semi; the operation fails if the source and destination are on different filesystems, if the source and destination are different kinds of item (that is, one is a file and the other is a directory), or if the destination is a non&hyphen;empty directory, except that it succeeds if the source and destination are the same directory&semi; a symbolic link is considered an existing file even if it is broken or it points to a directory&period; On all platforms, if `oldPath` is a symbolic link, the link will be moved, not its target&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The parameterized `OLD&lowbar;STRING&lowbar;TYPE` and `NEW&lowbar;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/move-07.adoc[move](
    char const* oldPath,
    char const* newPath);
----

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

Same as the overload taking `const char &ast;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class OLD&lowbar;STRING&lowbar;TYPE,
    class NEW&lowbar;STRING&lowbar;TYPE&gt;
static
int
xref:BloombergLP/bdls/FilesystemUtil/move-06.adoc[move](
    OLD&lowbar;STRING&lowbar;TYPE const& oldPath,
    NEW&lowbar;STRING&lowbar;TYPE const& newPath);
----

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


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