Sunday, 10 March 2013

Re: [gccsdk] unixlib directory iteration doesn't work on Fat32FS

On 10 Mar 2013 Ralph Corderoy wrote:

> Hi Matthew,
>
> > The telldir function has to return a long int which says where we
> > currently are in reading the directory and these special
> > subdirectories. The seekdir function has to take that value and turn
> > it back into a GBPB position in the directory and in the corresponding
> > subdirectory if we are in the middle of one.
>
> Given the DIR that these functions use is opaque, it seems to me it
> could store an array of every unique (dir, sub) RISC OS position ever
> returned by telldir(), with telldir returning the index, and seekdir()
> plucks the tuple from that index. I don't see anything in the POSIX man
> page that suggests telldir results have an ordering, merely they can be
> passed back to seekdir.
>
> No clean-up of the list is possible until the whole DIR is scrapped with
> closedir(), but it's unlikely to be a problem in practice.

That would be a nice safe method. You still have the issue of working out
what the R4 values ought to be for resuming from that position, and for that
to work the code will have to be modified to read one directory entry at a
time from OS_GBPB 10, rather than several as it is doing at present. There
is no getting away from that.

--
Matthew Phillips
Durham

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment