Fixed _stat64 problem.

All of this code should eventually be replaced with something like Boost::filesystem.