From: Sven U. <sve...@gm...> - 2011-06-17 11:08:52
|
Hallo Wesley, > > I believe getattr's file size is used by fuse. If you are > > returning zero, the extra stuff in a read past the size wont > > matter. You might check on that first. > > I did some tests and i think you're right. Many smartcards don't > report the file size so i returned 0 bytes in getattr. I not changed > it to a static value and that made the hello world read function > work. > > Is there any way to work around this ? As said, many cards don't > report their file sizes and i'm also planning to return an > interpreted version of the data instead of the raw data so there > would be no way to guess that before actually reading the file. And pre-reading it, presumably, would be to expensive. > Could i for example just report a (relatively) large file size so my > data will always fit in ? Not particularly elegant, but ought to work. After all, read() needs to be able to deal with files getting truncated while reading anyway. And, of course, once read you could cache that size :-) Sven -- __ _ _ __ __ __ / _` || ' \ \ \ / http://www.svenutcke.de/ \__, ||_|_|_|/_\_\ http://www.dr-utcke.de/ |___/ Key fingerprint = 6F F8 55 1C F9 E3 A8 F7 09 DF F7 2C 25 0C 54 53 |