burned by shell yet again
dam-pro.girard at laposte.net
Sun Mar 23 10:37:00 EDT 2008
If you do not want to pass through the shell() command with Revolution,
you can use this trick that I am using.
Rev create a shellscript file in a temporary folder.
Your shellscript write results of your command in another file.
http://url.written.wrongly.on.purpouse.by.bjoernke.com > myfile.txt
Use the launch command to launch the shellscript (personnaly in order to
stay compatible with all Unix operating system, I use /bin/sh).
After, your rev app check every few seconds the content of myfile.txt.
And you can monitor everything that you want with that.
Note: I think that this work, I will try that once my Linux booted. (I
developp on Windows).
Björnke von Gierke a écrit :
> On linux with the latest rc of 2.9, I am trying to get an url
> asynchronous into a file, as to not reduce interactivity of my rev
> stack. However I am unable to find a solution, without running a
> second rev program, because shell behaves so strangely different in
> Rev then in the terminal. My problem is that Rev always waits for
> wget, no matter how I try to trick it. All my trials and successful
> running tests in terminal didn't help me.
> The script I use is this (I used a wrong url because that results in
> longer wait times for wget):
> wget -q -P/path/to/folder
> http://url.written.wrongly.on.purpouse.by.bjoernke.com &
> -q no live logging to the terminal
> -P custom path to save file under
> & run command without waiting, return null immediately
> In terminal I noticed that the program does terminate immediately, but
> sometimes output stuff, of which I know that Rev has problems with. I
> presume these where information about the subtask spawned by "&".
>  24800
> So i put the string into a file, which i then called:
> bash downloadfile
> this did return immediately in the terminal, and didn't return
> anything. Unfortunately, Rev still doesn't return control immediately.
> I hate shell commands :(
More information about the Use-livecode