Dynamic new folder creation

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!

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

/c

Checkout the python os module.

thanks guys…

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

this worked!

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

1 Like