Category : C Source Code
Archive   : C-TOOLBX.ZIP
Filename : DOCCREAT.C

 
Output of file : DOCCREAT.C contained in archive : C-TOOLBX.ZIP
/* doccreat.c - creat a document index and data file */
#include "stdio.h"
#include "cminor.h"
#include "btree.h"
#include "bt_macro.h"

#define WR_MODE 1 /* write access for open */
extern ENTRY dume ;
extern int ndum ;

main(argc,argv)
int argc ;
char *argv[] ;
{
int ret ;
char fn[65] ;
RECPOS fs ;

if( argc < 3 )
{ printf(" USAGE: - doccreat doc-file-name file_size \n") ;
exit(5) ;
}

add_str(fn,argv[1],".idx",&fs) ;

ret = sscanf(argv[2],"%1d",&fs) ;
if( (ret == 0) || (fs < 0) )
{ printf(" bad file size specification \n") ;
exit(6) ;
}

if( creatix(fn,fs,&dume,ndum) < 0 )
{ printf(" can't create the index file \n") ;
exit(10) ;
}

add_str(fn,argv[1],".dat") ;
ret = gcreat(fn,WR_MODE,BIN_MODE) ;
if( ret < 0 )
{ printf(" can't create the data file \n") ;
exit(12) ;
}
close(ret) ;
}







  3 Responses to “Category : C Source Code
Archive   : C-TOOLBX.ZIP
Filename : DOCCREAT.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/