Linux - ExecFile (System_) Help!

BlitzMax Forums/BlitzMax Programming/Linux - ExecFile (System_) Help!

Yeshu777(Posted 2010) [#1]
Ok, the initial project was written in B+ running on WinXp Embedded, have been asked to port it to Linux.

The main program itself runs as expected (gfx & sounds), however I've hit a wall when it comes to replacing my use of ExecFile().

I've created scripts to replicate the cmd functions that were used on Windows to adjust the system volume.

Eg. The change volume script is as follows:

volume10.sh

amixer -q -c 0 set PCM 255
amixer -q -c 0 set Master 64

It's permissions allow it to be executed as a program.

Running the command $ ./volume10.sh within a terminal in the game directory works fine, volume changed as expected.

Now to BlitzMax..

ExecFile no longer exists, replaced by System_, OpenURL etc..

I've placed System_("./volume10.sh") in the main loop & wait for F1 to be pressed.

On pressing F1, I display a message you've pressed F1, (which it does) and then execute the above system command and it just sits there.. volume unchanged and program hangs.

I've checked using CurrentDir() that the program is looking in the main game directory (displaying CurrentDir on program init), where the scripts reside.

If anyone has previously executed a shell script using BMax Linux then I'd be most grateful if they could post an example.

Best Regards,


plash(Posted 2010) [#2]
Just try using system_("sh volume10.sh").


Yeshu777(Posted 2010) [#3]
Thanks..

Tried it and hangs.

As a test I have even tried to launch gedit... similar result.

Running Bmax 1.30


markcw(Posted 2010) [#4]
BMax 1.30 is bound to be your problem. Upgrade to 1.36.

I just tested it works here with the firepaint sample with this...
	If KeyHit(KEY_F1) Then System_("./systemtest.sh")

in the main loop and this for the systemtest.sh...
#!/bin/bash

amixer -q -c 0 set PCM 255
amixer -q -c 0 set Master 130
exit $?;

Which set the master to 100%. Btw I couldn't hear sounds at the level you had it at.


Yeshu777(Posted 2010) [#5]
Many thanks...!

PS. My Master volume is 64 at Max, according to amixer.


markcw(Posted 2010) [#6]
Hmm, it must be 64*2 on my system then.


Yeshu777(Posted 2010) [#7]
Updated to 1.36, system_(foo) works like a charm.

Many thanks markcw.