Further improvements in large files support, using stat64 instead of stat