stat should throw runtime_error if not successful