Use file.contents.length instead of file.stat.size