How about using [`getAttributes`](http://dlang.org/phobos/std_file.html#.getAttributes)?