Re: [AVFS] Problems with fork, Questions about avfs
Ralf Hoffmann <[email protected]> Fri, 18 Feb 2005 13:32:45 +0100
| Newsgroups | gmane.comp.file-systems.avfs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, On 02/18/2005 11:11 AM, Miklos Szeredi wrote: >>Do I understand you correctly that you want to test for real file in >>lookup_segment before calling lookup_avfs? This could be a good >>solution. For the example "/tmp/test#test/x" we have a valid ventry for >>"/tmp/test" and now trying to lookup "#test". We need to get "#test" >>into the ventry. With this ventry I could call av_file_open. I think the >>result should be enough information, stat is not really needed. If it >>works there is a local file and we know to ignore the magic. This also >>works when testing for such special files in virtual files. >> >>On the other hand this wouldn't work for "test.tar.gz#ugz#something". >>lookup_segment wouldn't find a valid file for "test.tar.gz#ugz" so it >>would call lookup_avfs for #ugz. > > > The really general solution would be to try appending the segments > until a '/' is found (in which case it's virtual) or until one file > did exist. In fact to be perfectly correct, the testing should start > from the whole path segement up to the slash, and if it doesn't exist > go backwards removing #foo until either no more # is found or one file > did exist. Does this sound too difficult? I already implemented the code I mentioned and it looks good. I still need some tests to be sure everything is okay especially for the undo step. But atleast I can access files like "test#" inside archives. I will think about your idea to go back until an existing file is found, it shouldn't be hard to add it to the code. Although I think it is acceptable to not be able to enter archives with the magic char in the filename, a general solution is much better. 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