~thekorn/+junk/fusepy

« back to all changes in this revision

Viewing changes to context.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:
14
14
    def getattr(self, path, fh=None):
15
15
        uid, gid, pid = fuse_get_context()
16
16
        if path == '/':
17
 
            st = dict(st_mode=(S_IFDIR | 0755), st_nlink=5)
 
17
            st = dict(st_mode=(S_IFDIR | 0755), st_nlink=2)
18
18
        elif path == '/uid':
19
19
            size = len('%s\n' % uid)
20
20
            st = dict(st_mode=(S_IFREG | 0444), st_size=size)