[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: system call: how to get access to results ?
From: |
rm |
Subject: |
Re: system call: how to get access to results ? |
Date: |
Sat, 16 Sep 2000 16:07:50 +0200 |
User-agent: |
Mutt/1.0.1i |
On Sat, Sep 16, 2000 at 03:23:25PM +0200, David Pirotte wrote:
> Hello,
>
> I have defined the following very simple function, to get access
> to the system date:
>
> (define (system-date . rest)
> (if (null? rest)
> (system "date '+%d-%m-%Y'")
> (system (format #f "date ~A" (car rest)))))
>
> However, I don't know how I can get access to the result, when sending
> a date string and expecting a result, such as:
>
> (system-date (format #f "--date='~A' '+%w'" "09/15/2000")
> 5
> 0
>
> The system "displays" the result, but returned value is the exit code
>
> How can I "get access" to the expected returned value ?
>
*--------------------------------------
|
| guile> (format #f "test\n")
| "test
| "
| guile> (format #t "test\n")
| test
| guile>
|
Hope this helps
Ralf