Does there exist a platform where readdir returns . and .. in other than the first two return values?
Hmm, good question! If any filing system would do this it would be reiserfs under linux. Reiserfs uses a hashed directory structure rather than the linear directory structure as used by most other fs. Reiser returns directory entries in hash order (a familiar concept to perl programmers!).
I just tried it and the answer is reiserfs always puts "." and ".." first! The hash order isn't as random as a perl hash either which is interesting too.