Author Topic: Create a Directory through the API  (Read 5428 times)

Are the exposed JS / Qt libraries capable of create OS folders? I need to create a number of sub-directories off my asset level directory in a plugin

Anything related to file management will requires to use fileIO. We don't have any functions yet to directly create folder. You could maybe achieve that by creating a file with the path of a folder that don't exist. Or by exporting textures.
Don't forget your log file. It can be exported from the Help menu of the software.
-----------
Fabrice Piquet aka Froyok. Product Manager, Technical Artist and Documentation at Adobe.

Interesting work around ideas.. Thanks. I'll have to give that a test soon

Looking at this issue again.. The workaround doesn't seem to work. The directory must first exist for the file to be written, so creating a temp file and deleting doesn't seem to be an option.

Code: [Select]
QDir doesn't seem to be exposed via the API, at least that I can find. Is it?

I've also tried
Code: [Select]
subprocess.check_call(mkdir) which interesting doesn't seem to work either. If I change the command to `explorer`and provide an existing path, the command works. It's only the
Code: [Select]
mkdir command failing.

Did you called the "mkdir" command as-is or is just an example ?
As I mentioned, any fileIO currently has to be handled by our API, you won't be able to use Qt functions here.
Don't forget your log file. It can be exported from the Help menu of the software.
-----------
Fabrice Piquet aka Froyok. Product Manager, Technical Artist and Documentation at Adobe.

I've taken to launching python scripts to handle anything like that.

just out of interest sake... where or what for do you want to make a directory?