Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Problems with 'call

 [1/5] from: tim-johnsons::web::com at: 19-Apr-2006 17:19


I'm picking up this topic again: there are features to 'call on linux that are downright baffling, and if I were to use it in an application, rather strange to me. Let's look at some examples:
>> res: call "ls *.r"
user.r ;; okay == 0 ;; exit code of 0 is correct ;; now let's introduce a legitimate call that has unsuccessful results res: call "ls *.cpp" ls: *.cpp: No such file or directory == 0 ;; hmmm! now let's do the same from the shell. [tim-linus tim]$ ls *.cpp ls: *.cpp: No such file or directory [tim-linus tim]$ echo $? 1 ;; NOTE the differences in the exit code. Now let's 'buffer' the output
>> buffer: copy ""
== "" res: call/output "ls *.r" buffer == 214 ;; say what?
>> buffer
== "user.r^/" ;; good ;; now the following is definitely unsettling, because it disables the ;; programmer's ability to gracefully handle errors:
>> clear buffer
== ""
>> res: call/output "ls *.cpp" buffer
;; Hoy moly, prints to stdout ls: *.cpp: No such file or directory == 214 ;; again exit code is inconsistant with shell command
>> buffer
== "" ;; and nothing in the buffer ;; Trying another refinement res: call/error "ls *.cpp" buffer == 214
>> buffer
== "ls: *.cpp: No such file or directory^/" ;; now that's a bit better, at least we've captured the error message. ;; but I'm still baffled about the anomalies in the exit codes. ;; BTW: using the /info refinement returns the same exit code as ;; an attribute Just curious. Does anyone think that this should be treated as a bug? Otherwise, I could wrap this in a function that could handle some of these inconsistancies. tim -- Tim Johnson <tim-johnsons-web.com> http://www.alaska-internet-solutions.com

 [2/5] from: greggirwin::mindspring::com at: 20-Apr-2006 9:54


Hi Tim, It sounds buggy to me, but maybe a real Linux user will jump in and say for sure (if they can dupe it and think you should RAMBO it). -- Gregg

 [3/5] from: tim-johnsons:web at: 20-Apr-2006 8:49


* Gregg Irwin <greggirwin-mindspring.com> [060420 08:25]:
> Hi Tim, > > It sounds buggy to me,
Yup.
> but maybe a real Linux user will jump in and > say for sure (if they can dupe it and think you should RAMBO it).
I've seen a posting from 1 linux user who showed different results, but didn't show the testing that I did... tim -- Tim Johnson <tim-johnsons-web.com> http://www.alaska-internet-solutions.com

 [4/5] from: tomc:cs:uoregon at: 20-Apr-2006 14:59


Hi Tim, I duplicated your examples on RH Linux & solaris I think it should be ramboed Tim Johnson wrote:
> I'm picking up this topic again: > there are features to 'call on linux that are downright baffling, and if
<<quoted lines omitted: 42>>
> these inconsistancies. > tim
-- ... nice weather eh tomc-cs.uoregon.edu

 [5/5] from: tim-johnsons::web::com at: 20-Apr-2006 15:16


* Tom Conlin <tomc-cs.uoregon.edu> [060420 14:09]:
> Hi Tim, > I duplicated your examples on RH Linux & solaris > I think it should be ramboed
Ramboed it is.... tj
> Tim Johnson wrote: > > I'm picking up this topic again:
<<quoted lines omitted: 55>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- 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