Does fileperms() work on directories, or just files? Otherwise, how can I get the permission of a directory?