Rebased pull request #306 (file_ops.c changes for mingw32)

One of these days I'll realize which branch I'm in before futzing with stuff...

This supersedes pull request #306.