~thekorn/+junk/fusepy

« back to all changes in this revision

Viewing changes to fuse.py

  • Committer: verigak
  • Date: 2009-06-19 09:08:15 UTC
  • Revision ID: svn-v4:1ebed218-b0a3-11dd-8075-91d349ce83ee:trunk:19
There is an incombatibility between Linux and Mac OS X concerning st_nlink of
directories. Mac OS X counts all files inside the directory, while Linux counts
only the subdirectories.

Changed the examples to follow Linux, but in general it should be harmless.

[thanks to Jim Wilcoxson for spotting it]

Show diffs side-by-side

added added

removed removed

Lines of Context:
475
475
    def getattr(self, path, fh=None):
476
476
        """Returns a dictionary with keys identical to the stat C structure
477
477
           of stat(2).
478
 
           st_atime, st_mtime and st_ctime should be floats."""
 
478
           st_atime, st_mtime and st_ctime should be floats.
 
479
           NOTE: There is an incombatibility between Linux and Mac OS X concerning
 
480
           st_nlink of directories. Mac OS X counts all files inside the directory,
 
481
           while Linux counts only the subdirectories."""
 
482
        
479
483
        if path != '/':
480
484
            raise OSError(ENOENT, '')
481
485
        return dict(st_mode=(S_IFDIR | 0755), st_nlink=2)