// file_comp.c
// $Id: file_comp.c,v 1.1.1.1 2007/09/19 05:49:54 sendan Exp $
// masashi shimakura
//


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>

#include"file_comp.h"
#include"../almemsys/almemsys.h"


int main(int argc, char * argv[])
{
FILE * fp;
int fd;
int stat;

if(argc < 1 || argc > 2){
   fprintf(stderr, "引数が異常ですよ \n");
   exit(1);
   }

stat = 0;
char * chB = (char *)calloc(IP_BUFF, sizeof(char));

if((fp = fopen(argv[1], "r"))!=NULL){
   fd = fileno(fp);
   chB = safe_filefdcat(fd, chB, &stat, MAX_BUFF, 5); // file をdataに読む
   if(0 > stat){
      fprintf(stderr, "SHELL FILE NOT OPEN %s\n",argv[1]);
      }
   close(fd);
   }

stat = file_comp(chB, "");

free(chB);

return 0;
}



