({{, (RefLink[CreateDirectory, paclet:ref/CreateDirectory])["dir"]
creates a directory with name dir. }, {, (RefLink[CreateDirectory, paclet:ref/CreateDirectory])[] 
creates a directory in the default area for temporary directories on your computer system.}})

OpenersNotesSection(Spacer1)Details and Options

If "dir" is a single name, (RefLink[CreateDirectory, paclet:ref/CreateDirectory]) creates a subdirectory of your current working directory.

(RefLink[CreateDirectory, paclet:ref/CreateDirectory])[(RefLink[File, paclet:ref/File])["dir"]] is also supported.

The directory created by (RefLink[CreateDirectory, paclet:ref/CreateDirectory]) is initially empty.

(RefLink[CreateDirectory, paclet:ref/CreateDirectory]) returns the full name of the directory it creates, and (RefLink[$Failed, paclet:ref/$Failed]) if it cannot create the directory.

(RefLink[CreateDirectory, paclet:ref/CreateDirectory]) has attribute (RefLink[Listable, paclet:ref/Listable]).

(RefLink[CreateDirectory, paclet:ref/CreateDirectory])[] creates a directory in the directory specified by the current value of (RefLink[$TemporaryDirectory, paclet:ref/$TemporaryDirectory]).

The default setting (RefLink[CreateIntermediateDirectories, paclet:ref/CreateIntermediateDirectories])->(RefLink[True, paclet:ref/True]) specifies that intermediate directories should be created as needed.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Create a directory:

dir=CreateDirectory[]

Check the presence of the new directory:

FileNames[dir]

Delete the directory:

DeleteDirectory[dir]

The directory is no longer there:

FileNames[dir]

OpenersExampleSection1(Spacer1)Scope  (1)

Create a directory specified as a (RefLink[File, paclet:ref/File]) object:

dir=FileNameJoin[{$TemporaryDirectory,CreateUUID["tmpdir-"]}];

CreateDirectory[File[dir]]

DeleteDirectory[File[dir]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DeleteDirectory, paclet:ref/DeleteDirectory])  ▪  (RefLink[RenameDirectory, paclet:ref/RenameDirectory])  ▪  (RefLink[CopyDirectory, paclet:ref/CopyDirectory])  ▪  (RefLink[CreateFile, paclet:ref/CreateFile])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Files and Directories, paclet:tutorial/ManipulatingFilesAndDirectories])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Directories & Directory Operations, paclet:guide/DirectoriesAndDirectoryOperations])}, {▪(RefLinkPlain[File Operations, paclet:guide/FileOperations])}, {▪(RefLinkPlain[External Operations, paclet:guide/ExternalOperations])}})}})