I'd like to skip my new strace-vs-ls --color test on any system (OS and/or file system) that lacks dirent.d_type support. Ideally, it'd be a tiny bourne shell, python or perl script to tell me if calling readdir on a given directory (let's say ".") would provide struct dirent data including usable d_type values. [For reference, some file system types do not support that, e.g., reiser3 and xfs, while others do, like ext4 and tmpfs. ]
Unfortunately, so far it appears there is no way to get to the d_type member from any of those languages. Does anyone know a way that does not require compiling and running a C program? I though strace -v might help, but e.g., strace -v ls empty-dir shows only the getdents syscalls. No details about readdir-returned data.