@zaphod42 I started down a similar path of using stat directly to retrieve file modes, but the `--format` option isn't supported on the version I have on my mac (we don't run the acceptance tests on that, yet). Instead there's:

<pre>
$ stat -f %p foo.txt 
100755
</pre>

Note that it includes `S_IFREG` in the resulting mode, whereas on GNU coreutils stat, I just get 755.

I assume the `--format` option is only supported on the version in GNU coreutils, but I don't know if that is on our Solaris acceptance test VM, and I have no idea what Windows will do here.

It may be better to invoke `ruby -e` to stat the file, and mask off any higher order bits `S_IFREG`, etc.