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

Michael Van Canneyt michael at freepascal.org
Fri Jan 7 00:13:15 CET 2005



On Thu, 6 Jan 2005, DrDiettrich wrote:

> Michael Van Canneyt wrote:
>
> > > method allows to enumerate all contained DirectoryItems.
> ...
> > On the condition that you also implement by default also a method returning
> > a TList or TStringList with TDirectoryItems. Not everyone is comfortable
> > with callbacks. The TList/TStringlist method should work fine for not-too-large
> > lists.
>
> It's not a matter of the lists, it's a matter of the required
> processing. When it takes the same time to build the list than to
> extract or decrypt all files, then one may prefer *not* to wait for the
> list before simply extracting all files.
>
> Of course it's always possible to build a file list, with a simple
> procedure that wraps the enumeration procedure.

This is what I had in mind.

>
>
> > > 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?
> >
> > No.
> > We have stuck to the lowest common denominator, i.e. Windows,
> > mainly for compatibility reasons.
> >
> > I think that if we're going to be having a new implementation, we should go
> > for the maximum, and provide sensible defaults for the 'lesser' OS-es.
>
> Could you imagine a procedure that gets an record with file attributes,
> as found in an archive, and then does the best with regards to the
> actual host system? I could write such a procedure for both Windows and
> e.g. Linux, provided the required OS calls are available. Would that
> mean that I had to use libc for the Unix part?

Using Unix/Baseunix, yes, this would be fine.
Note that not all attributes can be set.

Michael.





More information about the fpc-devel mailing list