#include <iostream>
#include <fstream>
#include <sstream>
#include <iterator>
#include <iomanip>
#include <memory>
#include <string>
#include <cctype>
#include <cstddef>
#include <list>
#include <set>
#include <vector>
#include <map>
#include <memory>
#include <stdexcept>
#include <algorithm>
#include <functional>
#include <chrono>
#include <random>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <experimental/filesystem>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include <values.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <errno.h>
#include <linux/limits.h> // for PATH_MAX
#include <assert.h>
#include <getopt.h>
#include <debug.h>
#include <fio.h>
#include <timer.h>
#include <swapit.h>
#include <glxstats.h>
#include <str.h>
#include <vec.h>

#include <Imath/ImathVec.h>
#include <Imath/ImathQuat.h>
#include <Imath/ImathMatrix.h>
#include <imathUtil.h>

using v3f = Imath::V3f;
using v3d = Imath::V3d;
using v3i = Imath::V3i;

const int FW=24;

using namespace std;

u32 readFortranRecord(int fin)
{
  u32 word;
  ssize_t res=read(fin,&word,sizeof(u32));
  if( res<=0 ){
    perror("read");
    throw std::logic_error("getbareword() failed");
  }
  if( needswap ) bin::swap32(&word, 1);
  return word;
}

void usage( std::string mesg=std::string() )
{
  if( not mesg.empty() ) std::cerr<<mesg<<std::endl;
  std::cerr<<"usage: frec [-s] file\n"
	   <<" -s : byteswap records\n";
  exit(0);
} // usage


int
main(int argc, char** argv)
{
  struct stat statBuf;
  if( stat(argv[optind], &statBuf) ){
    perror("stat");
    return 0;
  }
  std::cout<<toa("filesize",FW)<<" "<<memsize(statBuf.st_size)<<"\n";

  off_t off=0;
  int fd = open(argv[optind],O_RDONLY);
  close(fd);
  return 0;
} // main
