0 votes
by Bill Codington (190 points)
Looking for best approach.  I have various sound and graphics files that get loaded in my application, where is best to put them for portability.  This isn't for wide distribution so I don't want an installation script.

I just noticed that if I have a saved program that has hard coded file includes such as:
create pic0 z", /home/pi/graphics/harp5.jpg"
create pic1 z", /home/pi/graphics/steeldrum3.jpg"
create pic2 z", /home/pi/graphics/bagpipe2.jpg"
create pic3 z", /home/pi/graphics/marimba2.jpg"
create pic4 z", /home/pi/graphics/didgeridoo3.jpg"

This won't work if I have a different home directory.  Such as: /home/kiosk

Possibilities:

1. Put everything in the same directory.  Too messy.

2. Is there a macro equivalent to ~ that will expand on execution?  If possible this would be easier for remote upgrades since permissions are simpler.

3. Put these files someplace like /usr/local/biils_silly_stuff/

1 Answer

0 votes
by Stephen Pelc (4.3k points)
Run SHOWMACROS. There should be a macro $HOME which expands to the current user's home directory. At start up, check for the existence of $HOME/graphics and create it if necessary.

There's a word (CHECKSYSINI) in VFXBase/IniParser.fth which sets up the INI files in the relevant system directory. MAKEDIRLEVELS could be useful from this.
...