[Gambas-user] accessing "embedded" project files from Shell command

Benoît Minisini gambas at ...1...
Thu Aug 28 22:01:28 CEST 2014


Le 28/08/2014 21:53, Kevin Fishburne a écrit :
> When you store data files in the project directory and compile the
> program those files are contained within the resulting .gambas
> executable. From within the program they can be accessed as though they
> were in the current directory. Is it possible to access (read only)
> those files using a command executed by Shell? For example:
>
> Shell "cat ./FileInProject"
>
> I'm making a very simple SoundFont previewer that calls fluidsynth with
> the passed SoundFont and a MIDI file embedded in the project/executable.
>
> I could load the embedded file then write it to the user's /tmp
> directory and pass that to fluidsynth, but won't if I don't have to.
>

No, but you can pass them to your shell command through a pipe, for example.

Or if you don't care with performance, you can extract the file from the 
*.gambas executable with the 'gba3' command:

$ gba3 -x <gambas executable> <file> | mycommand

Or:

$ gba3 -x <gambas executable> <file> > tmpfile
$ mycommand tmpfile

Regards,

-- 
Benoît Minisini




More information about the User mailing list