Re: [AVFS] Problems with fork, Questions about avfs
Ralf Hoffmann <[email protected]> Thu, 10 Feb 2005 11:30:50 +0100
| Newsgroups | gmane.comp.file-systems.avfs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
On 02/09/2005 10:01 PM, Miklos Szeredi wrote:
> OK. How about doing the lstat() up to the path component containing
> the magic char, and if it exists iterating until a nonexisting one is
> found or no more magic char is present?
If I understand you correctly, basically my code does this already.
Until a path component contains the magic char, no lstat is executed.
For this component the code will check the existence and continue to the
next component containing the magic char (again no lstat is used for
"clean" segments).
For the more common case of accessing local files without a magic char,
lstat is not used at all.
If you mean to do this test outside parse_path than I think this should
be also okay.
Something like this (pseudocode) could work:
name = ps->path
for(;;) {
while ( *name && *name != '#' ) name++;
while ( *name && *name != '/' ) name++;
*name = 0;
if ( lstat( name ) != 0 )
break;
}
initial_seglen = name - ps->path;
return parse_path( ps, initial_seglen )
But on the other hand I don't see any benefit from this solution. Also
my code can be extented to allow for supporting files containing #
inside archives if the lstat of the corresponding avfs struct is used
(ps->mnt->avfs->lstat()?).
BTW, I'm subscribed to the list so there is no need to CC me.
Best Regards,
Ralf Hoffmann
--
Homepage: http://www.boomerangsworld.de
E-Mail: Ralf Hoffmann <[email protected]>
english or german
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click