home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
GLEN
/
DECAP.ZIP
/
DECAP.C
next >
Wrap
Text File
|
1988-05-29
|
1KB
|
52 lines
/* decap - filter to remove MacBinary header (first 128 bytes) */
/* Ariel Frailich - CompuServe 72477,326 - CRS - GEnie A.FRAILICH */
/* v.1.0 26/05/88 initial release, written in Manx Aztec c */
#include <stdio.h>
FILE *fopen() ,
*infile ,
*outfile ;
main( argc , argv )
int argc ;
char **argv ;
{
int c ;
if ( argc != 3 )
{
printf( "\n\nusage: decap infile outfile" ) ;
exit( 1 ) ;
}
if ( ( infile = fopen( argv[ 1 ] , "r" ) ) == NULL )
{
printf( "\n\ncouldn't open input file -- aborting." ) ;
exit( 2 ) ;
}
/* "x" means create new file */
if ( ( outfile = fopen( argv[ 2 ] , "x" ) ) == NULL )
{
printf( "\n\noutput file already exists -- aborting." ) ;
exit( 3 ) ;
}
if ( fseek( infile , 128L , 0 ) != 0 )
{
printf( "\n\nbad input file -- aborting." ) ;
exit( 4 ) ;
}
while ( ( c = getc( infile ) ) != EOF )
putc( c , outfile ) ;
fclose( infile ) ;
fclose( outfile ) ;
exit( 0 ) ;
}