[win] Use proper file system APIs.