Using 'call
[1/5] from: tim-johnsons:web at: 18-Apr-2006 8:21
using REBOL/Core 2.6.2.4.2
If I do this:
res: call "ls *.r"
;; I get output and
>> res
== 0
;; standard return value for system call
but if I do this:
>> listing: copy "" ;; output buffer
res: call/output "ls *.r" listing
>> res
== 204
;; I'm curious about the reason for the value of res.
It is not the length of 'listing, listing is appended with each
call to 'call.
Just curious.
Does this signal an error?
tim
--
Tim Johnson <tim-johnsons-web.com>
http://www.alaska-internet-solutions.com
[2/5] from: greggirwin:mindspring at: 18-Apr-2006 10:35
Hi Tim,
TJ> but if I do this:
>>> listing: copy "" ;; output buffer
TJ> res: call/output "ls *.r" listing
>>> res
TJ> == 204
TJ> ;; I'm curious about the reason for the value of res.
TJ> It is not the length of 'listing, listing is appended with each
TJ> call to 'call.
TJ> Just curious.
TJ> Does this signal an error?
AFAIK, the result of call is always the exit code of the process (and
a non-zero result means an error, yes). You can use the /info
refinement, and probe the result, to see for sure.
I don't know what a 204 result for ls is though, or why it only occurs
if you're grabbing the output. Sub'ing DIR for ls here (on Windows),
returns 0 either way. Hopefully someone on Linux will jump in here.
-- Gregg
[3/5] from: tim-johnsons:web at: 18-Apr-2006 9:00
* Gregg Irwin <greggirwin-mindspring.com> [060418 08:40]:
> Hi Tim,
> AFAIK, the result of call is always the exit code of the process (and
<<quoted lines omitted: 3>>
> if you're grabbing the output. Sub'ing DIR for ls here (on Windows),
> returns 0 either way. Hopefully someone on Linux will jump in here.
;; Thanks Gregg. Using /info gives me this:
>> probe res
make object! [
id: 31269 ;; process ID?
exit-code: 204 ;; hmm! will post to linuxquestions.org
]
tim
--
Tim Johnson <tim-johnsons-web.com>
http://www.alaska-internet-solutions.com
[4/5] from: hallvard:ystad::gmail at: 18-Apr-2006 20:13
On 18/04/06, Tim Johnson <tim-johnsons-web.com> wrote:
> ;; Thanks Gregg. Using /info gives me this:
> >> probe res
<<quoted lines omitted: 3>>
> ]
> tim
That's odd indeed. I get exit code 0 :
>> res: call/output/info "ls *.r" listing
>> probe res
make object! [
id: 26911
exit-code: 0
]
>> q
> uname -a
OpenBSD babelserver.org 3.8 GENERIC#1 i386
HY
[5/5] from: tim-johnsons::web::com at: 18-Apr-2006 11:54
* Hallvard Ystad <hallvard.ystad-gmail.com> [060418 10:22]:
> On 18/04/06, Tim Johnson <tim-johnsons-web.com> wrote:
> >
<<quoted lines omitted: 16>>
> > uname -a
> OpenBSD babelserver.org 3.8 GENERIC#1 i386
FYI: My machine specs are:
uname -s -r -m -p -i -o
Linux 2.4.20-20.9 i686 athlon i386 GNU/Linux
Maybe RT has an idea. I'm not complaining about the results.. :)
just curious
tj
--
Tim Johnson <tim-johnsons-web.com>
http://www.alaska-internet-solutions.com
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted