Previous Next Table of Contents

2. Installation

Most of the new code for this patch are in the files extension-fileio.c and extension-fileio.h. These files contain the header and implementation for all of the new builtin functions. One line has to be added to bf_register.h and a related line must be added functions.c.

The distribution archive should contain the text version of this documentation (fileio-README), extension-fileio.c, extension-fileio.h, and fileio.patch.

If you are going to use patch to install it, just copy fileio.patch into the server directory and apply the patch:

  patch < fileio.patch

It is recommended that you use patch to install it, but you can also manually make the changes to the server source. First, copy the extension-fileio.c and .h files into a directory with the freshly untarred server source. Add extension-fileio.c to the CSRCS line of Makefile.in, add

   extern void register_fileio(void);
to bf_register.h and add
  register_fileio
to the list of functions in functions.c.

Finally, make the files directory in the directory the MOO server is run in. Only files in this directory will be accessible using this patch.

  mkdir files

Pathnames passed to these functions are restricted to prevent access outside this directory.


Previous Next Table of Contents