Welcome to %s forums

BrainModular Users Forum

Login Register

Usine base directory

I need help on a Patch
Post Reply
sm_jamieson
Member
Posts: 559
Contact:

Unread post by sm_jamieson » 05 Mar 2015, 19:56

In Fastscript, is there a way to find out the Usine base directory, i.e. the directory the executable was launched from ?
I need to know this in order to read in a stringlist file from a subdirectory.
Simon.

sm_jamieson
Member
Posts: 559
Contact:

Unread post by sm_jamieson » 05 Mar 2015, 20:14

Note: I had been using a relative file path. i.e. relative to whatever the "currrent" directory was. The "current" directory was the usine launch directory when the script initialised, but it must have changed after a while and the file reads stopped working.
Simon.

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 20 Mar 2015, 18:01

Hi Simon,

I too am looking into some file-handling relative to the current Usine base-directory.
Have you had any luck determining how to set the path based on this?

-S
"Every act of creation is first an act of destruction." -Picasso

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 20 Mar 2015, 19:11

So yes, it seems that the directory the FastScript refers to is the actual directory currently selected by Hollyhock in general.
I wish the full Pascal functions were available as there are options for Get and Set of the directory as well as directory creation.

Senso would this be possible to implement?

-S
"Every act of creation is first an act of destruction." -Picasso

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 20 Mar 2015, 19:54

So one workaround I am doing at the moment:

This seems like the only logical workaround without an expanded Fastscript, such as Pascals Get/Set/Create directory functions.

Until these functions become available, or if there are any alternatives we don't know about:
At the moment should be able just to set the base directory and read a dummy file once, to give a path to your Fastscript.

You could also read the Master Setup panel and pull the directory for one of the pre-set folders such as the MIDI directory, alternate drive, etc...


-S
"Every act of creation is first an act of destruction." -Picasso

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 21 Mar 2015, 17:34

Hi sm_jamieson!

So Senso has provided some updates for this specifically you will find in HH2.
Refer to the Declarations and References page, where this info can be found.
function PathDelim:string; // returns '/' on MACOS, '' on windows
procedure CreateDir(dir:String);
function GetApplicationPath:string; //give the absolute path of the current Usine's folder
Very interesting for Windows / MAC OS compatibility, I was always wondering what the PathDelim was:
Just learned that it should be used when specifying paths for compatibility since the difference between Windows / MAC file path differences of
forward/back slash.

Also if saving data, I was originally using the Resources folder for my location.
I was told it was probably more appropriate to utilize the Config location to place as a Data location, since Resources are applicable to change and can be Private.

Definitely exciting, can't wait for Hollyhock II

-S
"Every act of creation is first an act of destruction." -Picasso

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests