#include void PrintUsage(void) { printf(" FolderChg Tool By Malcolm Smith Takes a calculator variable on the PC and changes the folder it will download into on the calculator. USAGE: folderchg infile outfile foldername [description] infile = Input filename outfile = Output filename foldername = Desired calculator folder name description = Description string, up to 40 characters. "); } int main(int argc, char *argv[]) { FILE *in,*out; long a; char temp; long total; char description[40]={' '}; char folder[8]={' '}; if(argc!=5 && argc!=4) {PrintUsage();return;} if(!strcmp(argv[1],argv[2])) { printf("Error: Input and output filenames must be different.\n"); PrintUsage(); return; } if(argc==5) { strncpy(description,argv[4],40); } strncpy(folder,argv[3],8); in = fopen(argv[1],"rb"); out = fopen(argv[2],"wb"); if(!in || !out) return; total=0; while(!feof(in)) { fgetc(in); total++; } rewind(in); total -= (10+8+40); for(a=0;a<10;a++) //8=calc signature, 2=magic hex code { temp = fgetc(in); fputc(temp,out); } for(a=0;a<8;a++) //folder name { fgetc(in); fputc(folder[a],out); } for(a=0;a<40;a++) //description string { temp = fgetc(in); if(argc!=5) description[a] = temp; fputc(description[a],out); } for(a=0;a