MOO-cows Mailing List Archive
fileio vs FUP
Several people have written to me asking what the difference between
FUP and fileio is. Here are the important reasons I write fileio
instead of using FUP for my own project:
FUP's primary file reading and writing operations work on lists.
Reading from the file returns a list and writing to a file is a
single atomic action that writes a list.
Fileio's primary interface is stdio-style streams. Opening a file
returns a handle that can be used as an argument to functions that
write or read to the file as a stream.
FUP has no provision for binary I/O and may allow raw binary data
into a MOO string (corrupting the database). Fileio uses a system
for binary I/O similar to the network functions.
There are also a number of potential efficency problems with FUP.
When FUP is reading from a file, it uses listappend which
potentially allocates a new list for each line being read. Writing
to a file involves copying the file to a temporary file, adding
lines, and renaming it.
Subject Index |