Hi t,

A file! type is a filename with a leading % character. Example: %myfile.r
%/c/mydir/. A file! may be any type of file, including a directory.

A port! datatype is a low-level i/o abstraction that REBOL uses to
serialize different types of i/o channels, such as files (here we are not
talking about the filename, but access to the file's contents), and socket
i/o. 

The access to ports is typically controlled by protocols that define how
information is read and written to a port, and also commonly implement some
convenient navigation functions for the port's datastream, such as first,
next, insert, pick, etc. These functions work in a sensible way on a port!
datatype. They enable you to treat ports as though they were series values
(i.e. blocks, paths, hashes ...) to a degree, hence the term serialize is
used to describe this type of access to i/o channels. 

There are some limitations, since not all ports lend themselves to being
treated as a series effectively with respect to all series! functions.

I haven't been following this thread, so I don't know why you are using
ports. Generally speaking, it is often more convenient to use higher level
functions when dealing with files, then accessing them as ports. read,
write, read/lines, write/append write/lines, write/append/lines, save,
load, come to mind. All of these functions take a filename (type file!),
and do not require that you manage the file on the port level, for instance
with respect to positioning, etc.


Hope this helps.



;- Elan >> [: - )]

Reply via email to