[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Test program for shel_write(SWM_LAUNCH, ...)



Hello,

I don't know if it's related to your point, but in windom the function ShelWrite() -- which is a replacement/extension of shel_write -- does some save/restore or current working directory.

http://windom.cvs.sourceforge.net/viewvc/windom/windom/src/shel_write.c?view=markup

Hope this helps.

Arnaud.



2013/10/20 <jflemaire@skynet.be>
Hi list,

Still trying to understand what's going on with the current working
directory of applications and so, not sure if my own programs were at
fault, I wrote a couple of the simplest possible GEM test programs that
exhibit the problem I'm facing.

Here's how to test: run swcaller.prg; it will display in a GEM alert box
the path it's sending the AES via shel_write() to launch swcallee.prg
2 times in a row. swcallee.prg will display it's current working
directory in an alert box.

Why 2 times? Because on my system, the 1st swcalle.prg instance has a
correct working directory (something like "F:\swtest") but the second
instance always has "U:\c\mint\1-19-CUR\XAAES". (NOTE: My suspicion is that on
other systems the current working directory is wrong everytime).

Needles to say, this doesn't help real applications that need to load
support files from their current working directory...

If you modify either of the programs, recompile with:
gcc -Wall -fomit-frame-pointer -O2 swcaller.c -o swcaller.prg -lgem -s
gcc -Wall -fomit-frame-pointer -O2 swcallee.c -o swcallee.prg -lgem -s
or somesuch.

Cheers,
JFL
--
Jean-François Lemaire