Don't use fileno() and fstat() to figure size (use ftell() + seek instead)