Directories are like files.... kinda...
listdir should return tuples for those too.
Fix this in 1.1.0
NB this discussion is probably unrelated, but kind of cool to have discovered
Just did a quick experiment, comparing the size of links with the length of the path (in characters/bytes) the link points to.
$ cat /etc/fedora-release
Fedora release 20 (Heisenbug)
$ mount | grep 'home'
/dev/foo_home on /home type ext4 (rw,relatime,data=ordered)
$ uname -a
Linux foo.com 3.15.6-200.fc20.x86_64 #1 SMP Fri Jul 18 02:36:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ echo $LANG
stat applied to a symbolic link (which contains only characters matching [a-zA-Z]:
$ mkdir simpledir
$ ln -s simpledir sd
$ file simpledir sd
sd: symbolic link to `simpledir'
$ stat -c '%s' simpledir sd
stat applied to a symbolic link (which contains characters matching [a-zA-Z] and a single → character (U+2192 RIGHTWARDS ARROW):
$ mkdir foo→bar
$ ln -s foo→bar fb
$ file foo→bar fb
fb: symbolic link to `foo→bar'
$ stat -c '%s' foo→bar fb
Compare to the following, which swaps the arrow character with a hyphen character
$ mkdir foo-bar
$ ln -s foo-bar f-b
$ file foo-bar f-b
f-b: symbolic link to `foo-bar'
$ stat -c '%s' foo-bar f-b
What this shows us is:
The size of the symbolic link is close to the length of the name of the path the link points to. Specifically, the number of bytes required to store the link target in memory. This is why link targets with plain ascii characters demonstrate the property where the number of characters in the destination is equivalent to the number of bytes required to store that path string in memory. This is also why links with UTF characters in the target measure larger than the number of characters in the link name. UTF characters require more space to store in memory.
I believe the size of 'foo→bar' and 'foo-bar' being exactly 2 bytes different has to do with the space required to store a UTF-8 character. I cannot find exact literature to support this assertion at this time. But it's what I recall previously reading.
Using http://mothereff.in/byte-counter I entered the two following values:
The byte-counter says that the former is 1 byte, and the latter is 3 bytes.