Make a File Directory

For general discussion related FlowStone
Post Reply
User avatar
aronb
Posts: 154
Joined: Sun Apr 17, 2011 3:08 am
Location: Florida, USA
Contact:

Make a File Directory

Post by aronb »

Hi,

I have looked around a bit and cannot seem to find out how to make a file directory to store a text file in.

For example, I have a text file (test.txt)
I want to create a directory, then store the file...

I can can create the file and save it, I just can't figure out how to use Ruby or any module to make a directory to store the file in :?:

Maybe I've just been looking to long for the answer :?

Thanks, Aron
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Make a File Directory

Post by trogluddite »

Ruby is able to do this via it's Dir module, and it's also possible by using the "Shell Execute" primitive to send a Windows system command.

Here's a module that does it using Ruby, which I prefer because it's easier to define your own action if the folder creation fails. Note that the 'create_folder' routine calls itself recursively with each parent folder name in turn, so it will create all of the folders necessary for the complete path, however deeply they're nested...
create_folder.fsm
(1.26 KiB) Downloaded 908 times
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Make a File Directory

Post by RJHollins »

Thanks TROG.

I've always used the PRIM FS modules for this deed.

But I got to say, it was one of the messier sections of the schematic [trying to keep connection path clean].

Seems it was always a challenge when transitioning out of FlowStone proper to the exported VST. But I did get
it working as needed. [what I needed was saving a TXT file into a dedicated FOLDER within an Audio Project Folder ... and have it Default to that [chosen] location.

I also used SPROG's technique of Saving parameters in a hidden PreSet Manager. Works nice.

Thanks again for the RUBY way !
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: Make a File Directory

Post by wlangfor@uoguelph.ca »

Thanks, that might come in handy

trogluddite wrote:Ruby is able to do this via it's Dir module, and it's also possible by using the "Shell Execute" primitive to send a Windows system command.

Here's a module that does it using Ruby, which I prefer because it's easier to define your own action if the folder creation fails. Note that the 'create_folder' routine calls itself recursively with each parent folder name in turn, so it will create all of the folders necessary for the complete path, however deeply they're nested...
create_folder.fsm
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
aronb
Posts: 154
Joined: Sun Apr 17, 2011 3:08 am
Location: Florida, USA
Contact:

Re: Make a File Directory

Post by aronb »

Very nice!!!

Thank you very much Trog :D

I figured there was something in Ruby... all my searches came back with using GEMS, which of course we can't really use easily :roll:

Aron
Post Reply