Folder creation within Files

455
3
Jump to solution
11-15-2019 02:03 PM
MichaelKellyTeck
Occasional Contributor

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

1 Solution

Accepted Solutions
DavidVitale
New Contributor III

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.

DavidVitale
New Contributor III

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

MichaelKellyTeck
Occasional Contributor

Thanks David - that's awesome.

0 Kudos