rockyone wrote:in basic omikron
I wanted to recover Shel_Read with the name of the launched program to differentiate its execution mode (ACC / PRG)
That's not, strictly speaking, what shel_read
is supposed to return. The shel_read call simply returns the last thing done with shel_write
. In many, if not most cases, that will be the command that launched the current program. But that's not guaranteed and shouldn't be relied upon.
rockyone wrote:For Shel_Read prg, although the non Contains the program launched
But for an accessory, the name returned by Shel_Read, does not correspond to the non-open accessory.
If I remember correctly, for an open accessory from the menu, the name contained in Shel_Read, is the last (I find it the right word) executed or initialized program.
No, shel_read only returns what was done with shel_write. If something is executed via GEMDOS function Pexec
without shel_write, then shel_read won't have any knowledge of it.
Under vanilla TOS, there is no 100% reliable way for a program to determine the executable file it came from.
However, looking for "ACC" or "PRG" in the filename isn't the right way to go about determining the launch mode anyway. Take a look at this article I wrote on the subject a LLLLLLLOOOOOOOOONNNNNNNNGGGGGGGG
freakin' time ago... http://dev-docs.atariforge.org/files/AR ... y-1991.pdf
Page 3 is where the article starts, and there's another article about desk accessory stuff after it.