SetCloudDirectory[dir]
sets the current working directory used for cloud objects to dir.
sets the current working directory for cloud objects to $CloudRootDirectory.
SetCloudDirectory
SetCloudDirectory[dir]
sets the current working directory used for cloud objects to dir.
sets the current working directory for cloud objects to $CloudRootDirectory.
Details
- In SetCloudDirectory, a directory can be specified either by a CloudObject or by a string. If the string begins with "/", the path is relative to $CloudRootDirectory, otherwise it is relative to CloudDirectory[].
Examples
open all close allBasic Examples (3)
Reset the current directory to the cloud root:
SetCloudDirectory[]A cloud object with a relative path now goes back to being placed in the user's cloud root directory:
CloudObject["count.txt"]Check the current cloud directory:
CloudDirectory[]Set the current directory to a subdirectory relative to the current one:
SetCloudDirectory["results"]A cloud object with a relative path name will be placed into the "results" directory:
CloudObject["nov.txt"]Set the current directory to a subdirectory relative to the root directory:
SetCloudDirectory["/planets/mars"]A cloud object with a relative path name is placed in the "/planets/mars" directory:
CloudObject["sample28.csv"]Scope (2)
A cloud object can be used to specify the new directory:
SetCloudDirectory[CloudObject["Base"]]A cloud object with a relative path goes there:
CloudObject["report.nb"]Setting to $CloudRootDirectory cloud object is the same as SetCloudDirectory[]:
SetCloudDirectory[$CloudRootDirectory]Similarly, you can use "/" to set the cloud directory to its root:
SetCloudDirectory["/"]Properties & Relations (1)
Using the two-argument form of CloudObject can achieve the same effect as setting a working cloud directory. Initialize a variable to a working cloud directory:
appDir = CloudObject["/myapp"]Use the variable as the second argument to CloudObject to indicate the base directory for the relative path in the first argument:
CloudObject["index.html", appDir]Possible Issues (1)
Be aware that calling SetCloudDirectory with a relative path (a path without a leading "/") will change the directory relative to the current directory, which can lead to confusion if you forget what the current directory is. Set the cloud directory:
SetCloudDirectory["Base"]Repeating the same call results in setting to a directory with the same name repeated:
SetCloudDirectory["Base"]To avoid the nesting, use an absolute path, adding a "/" to the beginning:
SetCloudDirectory["/Base"]Another way to avoid the nesting is to reset to the default first:
SetCloudDirectory[];
SetCloudDirectory["Base"]Related Guides
History
Text
Wolfram Research (2014), SetCloudDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/SetCloudDirectory.html.
CMS
Wolfram Language. 2014. "SetCloudDirectory." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SetCloudDirectory.html.
APA
Wolfram Language. (2014). SetCloudDirectory. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetCloudDirectory.html
BibTeX
@misc{reference.wolfram_2026_setclouddirectory, author="Wolfram Research", title="{SetCloudDirectory}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/SetCloudDirectory.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_setclouddirectory, organization={Wolfram Research}, title={SetCloudDirectory}, year={2014}, url={https://reference.wolfram.com/language/ref/SetCloudDirectory.html}, note=[Accessed: 13-June-2026]}