# FUP

Rich Connamacher (phantom@baymoo.sfsu.edu)
Thu, 25 Apr 1996 20:05:36 PDT

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    > How I redirect the output of that program to a file? Maybe thus I can use
    > fileread() to display the everchange output... (am I wrong??)

    This would actually be pretty simple.  According to the FUP.README, you
    can specify the input file and output file as arguments to filerun().  I
    assume that the input / output files are located in the files/ directory,
    but after rereading the entry in FUP.README, I'm not sure.  But that'd
    make sense, because it doesn't explicitly say otherwise.  So, this'd work...

    filerun(ls, {}, {"bin.outdir","ls.out"});
    while (!fileexists("bin.outdir", "ls.out"))
      suspend(0);
      /*Give the ls task, which appears to be run as a separate task from the
    MOO, time to finish running*/
    endwhile
    output = fileread("bin.outdir", "ls.out");
    player:tell_lines(output);

    Granted, this approach has a suite of problems, like what happens if ls
    is only half finished writing to ls.out, or what happens if there's two
    calls to this verb going at the same time.  But this should give you some
    idea.

    Phantom