Question about Mindy's system method 
Author Message
 Question about Mindy's system method

Hi everyone,
   I've been trying to use mindy's system() method to set a variable
with the current date. Basically,

   let OUT = system("date");
   format(*standard-output*, "%=\n", OUT);

what this gets me is the date at the command line and then 0. So, what
this does is the date command gets executed and the result is 0, which
is what OUT is set to. Is there any way to intercept the date part? Or
is there a better way of doing this? I've thought about using the system
method to set an environment variable and then bring that in, but before
I head off on that tangent, I thought I would ask for other opinions.

Thanks,
Brad



Tue, 21 Sep 1999 03:00:00 GMT  
 Question about Mindy's system method

Quote:

> Hi everyone,
>    I've been trying to use mindy's system() method to set a variable
> with the current date. Basically,

>    let OUT = system("date");
>    format(*standard-output*, "%=\n", OUT);

> what this gets me is the date at the command line and then 0. So, what
> this does is the date command gets executed and the result is 0, which
> is what OUT is set to. Is there any way to intercept the date part? Or
> is there a better way of doing this? I've thought about using the system
> method to set an environment variable and then bring that in, but before
> I head off on that tangent, I thought I would ask for other opinions.

I've used fd-exec in the file-descriptors module successfully
to do this. It returns input and output file desciptors, from
which you can construct a stream.

Jonathan Moody



Wed, 22 Sep 1999 03:00:00 GMT  
 Question about Mindy's system method


  At which point did  #f become an instance of the class <byte-string> ? :-)
  Perhaps "" might do as a default value instead.

Quote:
>//////////////////////////////////////////////////////////////////////////
>define method get-date-as-string()
>                => the-date :: <byte-string>;
..
>  let the-result = #f;
>  if (in-fd & out-fd)
...
>  end if;
>  the-result;
>end method;

--

Lyman S. Taylor          "Any sufficiently advanced technology is

                                   -- paraphrased Arthur C. Clarke
                                        seen somewhere on the USENET



Thu, 23 Sep 1999 04:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Mindy NT 'Bogus Opcode'

2. 'system' and variables (newbie question)

3. drb -- distrib'd ruby and marshalling, question about methods

4. Questions on 1.6a2's string methods

5. vrml 2.0 activeX control that allows java methods to access container's methods

6. Recursive methods with :around's and call-next-method results

7. Object Tcl question - Class method and Instance method

8. Question about SICP's query system...

9. Tk system fonts don't match actual system fonts

10. LabVIEW's equivalent to Excel's GoalSeek method

11. Method type 'abstract'

12. 'bind' functions into methods

 

 
Powered by phpBB® Forum Software