MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
Re: FUP
> 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
Follow-Ups:
- {n/p}curses
- From: "Junkie's 'R' Us" <junky@photocraftlab.com>
References:
- FUP
- From: Guilherme Ramos <gkramos@freire.futuro.usp.br>
Home |
Subject Index |
Thread Index