Page 1 of 1

Posted: 05 Mar 2015, 19:56
by sm_jamieson
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.

Posted: 05 Mar 2015, 20:14
by sm_jamieson
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.

Posted: 20 Mar 2015, 18:01
by sephult
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

Posted: 20 Mar 2015, 19:11
by sephult
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

Posted: 20 Mar 2015, 19:54
by sephult
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

Posted: 21 Mar 2015, 17:34
by sephult
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