home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 3
/
FREEWARE.BIN
/
towns_os
/
tvi
/
tvi_src.lzh
/
C
/
THEADCUT.C
< prev
Wrap
C/C++ Source or Header
|
1990-11-13
|
1KB
|
50 lines
/******************************************************************************
$Header: theadcut.cv 1.2 90/11/13 20:37:34 Nam Exp $
*******************************************************************************/
#include <stdio.h>
#define BSIZE (1024)
extern void exit();
void main(argc,argv)
int argc;
char *argv[];
{
FILE *fp1,*fp2; /*** ファイル構造体 ***/
int i,j;
char buf[BSIZE+1];
if (argc<2){
printf("Usage: theadcut.exp / Cutting Tiff-file's Header\n");
printf(" >run386 theadcut ???.tif ???.img\n");
exit(1);
}
fp1=fopen(argv[0],"rb"); /*** ファイルをOpen ***/
if (fp1==NULL) {
printf("tvi_rec.tifをopenできません\n");
exit(1);
}
if (fseek(fp1,0x0200,SEEK_CUR)!=0){
printf("tvi_rec.tifのヘッダがありません\n");
fclose(fp1);
exit(1);
}
fp2=fopen(argv[1],"wb"); /*** ファイルをOpen ***/
if (fp2==NULL) {
printf("tvi_rec.imgをopenできません\n");
fclose(fp1);
exit(1);
}
while (fp1!=NULL) {
i=fread(&buf,1,BSIZE,fp1);
j=fwrite(&buf,1,i,fp2);
if ((i<1)||(i!=j)){
fclose(fp1);
fclose(fp2);
break;
}
}
exit();
}