/* Author : Rick van der Zwet * S-number : 0433373 * Version : $Id: compressie.cc 330 2007-11-25 23:31:30Z rick $ * Copyright : FreeBSD Licence */ #include #include #include #include #include "fileio.h" /* XXX: File are only checked at creation time, not during execution */ int main(int argc, char ** argv) { FILE * output; int number; int temp; if (argc < 3) { fprintf(stderr, "Usage: %s []\n",argv[0]); return(EX_USAGE); } output = fopen(argv[1], "w"); if (output == NULL) { fprintf(stderr,"Error: Unable to use `%s', errno: %i\n", argv[2], errno); return(EX_CANTCREAT); } for (number = 2; number < argc; number++) { temp = atoi(argv[number]); printf("%i ", temp); tofile(output, temp); } closefile(output); printf("\n"); fclose(output); return(EX_OK); }