[DGD] system() command
Par Winzell
zell at skotos.net
Sun Jun 2 16:14:37 CEST 2002
> There's some way to use the system() comand to get the result to the mud??
>
> For example system("ls"); and get the output to a variable in the mud
Definitely not. There are two workable methods. In one, you write a little
servlet in Perl or somesuch that communicates with DGD over the network. It
can accept requests such as 'perform an ls and return the result'.
A slightly simpler and much dirtier method is to use files in a directory
and another little servlet that polls for such files continously. For
example if you want the output of 'ls' you could have DGD write a file
called /sysreq/485.req (or whatever) with the word 'ls' in it; the external
Perl process could perform the command and channel output to
/sysreq/485.out, which in turn DGD could write.
The latter method requires polling both by the servlet process and by DGD
whereas the first one can be entirely callback-based. If you run a DGD with
only the telnet/binary port combo, however, you'll use up one of those for
this purpose (unless you do some fancy multiplexing).
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list