# Dynamic new folder creation

**URL:** <https://forum.inductiveautomation.com/t/dynamic-new-folder-creation/11463>\
**Category:** Ignition\
**Created:** [April 4, 2016, 8:45pm UTC](https://forum.inductiveautomation.com/t/dynamic-new-folder-creation/11463 "2016-04-04T20:45:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowgoer](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@snowgoer](https://forum.inductiveautomation.com/u/snowgoer)\
**Post date:** [April 4, 2016, 8:45pm UTC](https://forum.inductiveautomation.com/t/dynamic-new-folder-creation/11463/1 "2016-04-04T20:45:21Z")

</div>

I’m newbie and did a bunch of searching but didn’t quite find an answer to this…

Is there a way to dynamically create a folder in a network directory location?

I’ve got the ‘system.file.writefile’ script working to save a file if the folder exists, but what if I need to create a new folder? The file path will be determined by an employee name. I need to have the folder name match another database field for proper linking.

A little background: I’m creating a training record database to store training records on machinery. When an employee operates the piece of equipment, the database will be checked to see if the employee has all the proper documentation for said piece of equipment.

if you need more info, let me know

thanks!

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [April 5, 2016, 2:00am UTC](https://forum.inductiveautomation.com/t/dynamic-new-folder-creation/11463/2 "2016-04-05T02:00:54Z")

</div>

Maybe try writeFile() and throw a dummy file in the folder?  
If not then you’ll have to use [java.io](http://java.io).

/c

---

<div class="post-metadata">

**Author:** ![markdobtech](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@markdobtech](https://forum.inductiveautomation.com/u/markdobtech)\
**Post date:** [April 5, 2016, 12:23pm UTC](https://forum.inductiveautomation.com/t/dynamic-new-folder-creation/11463/3 "2016-04-05T12:23:42Z")

</div>

Checkout the python os module.

---

<div class="post-metadata">

**Author:** ![snowgoer](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@snowgoer](https://forum.inductiveautomation.com/u/snowgoer)\
**Post date:** [April 5, 2016, 1:53pm UTC](https://forum.inductiveautomation.com/t/dynamic-new-folder-creation/11463/4 "2016-04-05T13:53:31Z")

</div>

thanks guys…

import os  
newpath = “filepath”  
os.makedirs(newpath)

this worked!

just need to add in the verification step if the directory already exists
