RenameDirectory

RenameDirectory["dir1","dir2"]

renames the directory dir1 to dir2.

Details

  • dir1 must already exist; dir2 must not.
  • RenameDirectory sets the modification date for dir2 to be the same as for dir1.
  • RenameDirectory returns the full new directory name, or $Failed if the directory cannot be renamed.
  • File["dir"] may be used to specify a directory name.

Examples

open allclose all

Basic Examples  (1)

Copy a directory:

List of files in the directory:

Rename the directory:

Delete the directory:

Scope  (1)

Rename a directory specified by the File object:

Wolfram Research (1991), RenameDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/RenameDirectory.html (updated 2016).

Text

Wolfram Research (1991), RenameDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/RenameDirectory.html (updated 2016).

CMS

Wolfram Language. 1991. "RenameDirectory." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/RenameDirectory.html.

APA

Wolfram Language. (1991). RenameDirectory. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RenameDirectory.html

BibTeX

@misc{reference.wolfram_2024_renamedirectory, author="Wolfram Research", title="{RenameDirectory}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/RenameDirectory.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_renamedirectory, organization={Wolfram Research}, title={RenameDirectory}, year={2016}, url={https://reference.wolfram.com/language/ref/RenameDirectory.html}, note=[Accessed: 21-November-2024 ]}