[756] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: tCD and ColdX mailing lists

daemon@ATHENA.MIT.EDU (Sun Jul 30 17:17:49 1995 )

Date: Sun, 30 Jul 1995 17:15:19 -0400 (EDT)
From: James C Deikun <jcdst10+@pitt.edu>
To: 869683 Gillespie Brandon James <brandon@riverheights.declab.usu.edu>
Cc: coldstuff@MIT.EDU
In-Reply-To: <9507301655.AA00637@riverheights.declab.usu.edu>



On Sun, 30 Jul 1995, 869683 Gillespie Brandon James wrote:

> Until then, I have a question on functionality:
> 
> I am currently in the process of adding a higher level of file control to
> the system.  Which of the following would you rather see:
> 
> read_file("filename", DBREF)
> 
> Where it opens file and reads blocks from it, sending them to DBREF until
> the file is at it's end.

Sending them how?  Just like net connections?

> Or:
> 
> open_file("filename", DBREF)
>   (opens the file, read's nothing)
> read_file()
>   (read's a block of the file associated with this object, returns it in
>    buffer form)
> close_file("filename", DBREF)
> 
> Furthermore, there will also be:
> 
> stat_file("filename")
> 
> which will return some basic information on the file (does it exist?  etc)

Hm.  The answer is: neither.  Files are more complex than net 
connections, you'd want to be able to seek around in them and the like.  
If it were up to me I'd make files first-class objects and add a somewhat 
ANSI-C-like but improved set of builtins for creating and accessing 
them.  Of course, then you run into the problem that ColdC doesn't do 
mutable types other than through dbrefs (a good move if you ask me) and 
doesn't support objects with native code implementations (a bad idea) so 
one of those conditions must be changed or you'd be replicating file 
handles right and left.

(I also campaigned for connections as first-class objects, and yes, there 
is a theme here.  However, connections being the way they are is much 
better than files being the way connections are, since connections have 
so much less associated state.)

--
James "mutable" Deikun
owner of the `no-members' mailing list