[fpc-devel] Abbrevia Port (was: Portability Standards)

DrDiettrich drdiettrich at compuserve.de
Tue Jan 4 02:06:35 CET 2005


Michael Van Canneyt wrote:

> > Question: What's preferrable, a direct port of the Abbrevia library, or
> > a new and better portable design instead, that interfaces with the not
> > otherwise available worker classes as implemented in Abbrevia?
> 
> Second option.

Here's my general idea of an Abbrevia compatible redesign:

The working name for this new project is Directories+DirectoryItems,
with a "di" prefix for the unit names etc. The project unifies the
handling of archives, compressed and encrypted files.

The basic objects are Directories and DirectoryItems. This should allow
to cover the file systems of all platforms, as well as archive files,
networks etc.

Directories are DirectoryItems themselves (subdirectories), in general
containers for DirectoryItems, with according management functions. One
method allows to enumerate all contained DirectoryItems. A callback
function can process the items and signal abort (when the file is found)
or recurse (into a subdirectory). This IMO is a better replacement for
the FindFirst/FindNext/FindClose crap, applicable also to the contents
of archive files.

Other DirectoryItems are files and links.
Links transparently wrap the linked file for file related operations,
and have additional methods for managing the links themselves
(redirect...).
File items can be opened and closed, open files have an according Stream
object/property.
Archive files must be mappable into Directories, somehow. A Mount method
might return the appropriate Directory object for the files inside an
archive.

Question:
On Posix (Unix?) file systems the ownership (UID, GID) as well as
specific file (executable...) and directory (sticky...) attributes are
important, when extracting files from archives. Does FPC already provide
according portable access and management procedures?

DoDi






More information about the fpc-devel mailing list