Folder creation within Files

1029
3
Jump to solution
11-15-2019 02:03 PM
by Anonymous User
Not applicable

Within Files, you have a home and a samplesdata folder. Is it possible to create additional folders?

1 Solution

Accepted Solutions
by Anonymous User
Not applicable

To make a single directory:

import os

if not os.path.exists("/arcgis/home/newdir"😞

    os.mkdir("/arcgis/home/newdir")

To make a subdirectories when none of them exist:

import os

os.makedirs("/arcgis/home/non-existent-dir1/non-existent-dir2/")

View solution in original post

3 Replies
NikhilShampur
New Contributor III

Yes - you can use python code to create folders in this location.

by Anonymous User
Not applicable

To make a single directory:

import os

if not os.path.exists("/arcgis/home/newdir"😞

    os.mkdir("/arcgis/home/newdir")

To make a subdirectories when none of them exist:

import os

os.makedirs("/arcgis/home/non-existent-dir1/non-existent-dir2/")

by Anonymous User
Not applicable

Thanks David - that's awesome.

0 Kudos