From: Miklos S. <mi...@sz...> - 2007-07-17 07:29:05
|
> > From what I get after a small glance at the code, a filesystem driver > > should know a file's size early. This isn't really possible for any of > > the compressed formats. Is it possible to simple return a filesize of > > null bytes, as does eg. the /proc filesystem without confusing the > > FUSE core? > > The way I dealt with this in fuseflt was to convert the files when the > output file was stat'ed and keep the output cached for some time in a > temporary file. The problem is that practically all file managers stat all > files as they enter a directory, so they would all be converted unless you > only do a simple `ls'. > > If there is a way to support files of undetermined size, I have yet to > find it. It _is_ possible to do that, by setting fuse_file_info->direct_io to 1 in the ->open() method. The drawback is that mmap() is not supported for such opens. So for example executing programs from the fs would not work. But most programs don't use mmap, so this shouldn't be a big problem. > > Should something like this be done in a single, quite complet FUSE > > filesystem, or in a modular way stacking them one to each other? > > Single is faster. Actually, with the new stacking infrastructure in fuse-2.7, there shouldn't be a noticable performance hit from doing it modularly. Miklos |