Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!amdahl!pyramid!prls!philabs!ttidca!clark From: clark@ttidca.TTI.COM (Ralph Clark) Newsgroups: comp.binaries.ibm.pc Subject: Thanks, I'd rather do it myself Message-ID: <2237@ttidca.TTI.COM> Date: 6 Apr 88 02:49:08 GMT Organization: Citicorp/TTI, Santa Monica Lines: 51 Keywords: self extracting arc Here is a simple program to convert a self-extracting archive back into a regular you-can-run-arc--t-on-it-before-you-spend-an-hour-downloading-it archive. Inquiry to three local gurus failed to produce a simple one-line shell command alternative. It will undoubtedly fail if you ask it to delete a googolplex of bytes from the head of a file. 9758 has been posted as the length of the extraction program - no doubt future or previous versions will vary. It is correct for skyplot.exe. Usage : lobotomy -9758 skyplot.arc (uudecoded first!) (not tested with any other example.) --------------------------cut here------------------------------------------ /* lobotomy.c * * a tool to strip a specified number of bytes from the front of a file * while copying stdin to stdout. */ #include main(argc,argv) int argc; char *argv[]; { int c,i,nbytes; if ((argc != 2) || (*argv[1] != '-') || ((nbytes = atoi(&argv[1][1])) <= 0)) printf( "Usage : %s -n, where n bytes are to be skipped from stdin to stdout", argv[0]); for (i = 0; i < nbytes; i++) if ((c == getchar()) == EOF) exit(0); while ((c = getchar()) != EOF) putchar(c); exit (0); } ----------------------------cut here-------------------------------------- Disclaimer: not responsible for damage caused by using this program to remove any useful bytes from your files. -- R. Clark (clark@TTI.COM) Citicorp(+)TTI 3100 Ocean Park Blvd. (213) 452-9191, x2965 Santa Monica, CA 90405 {csun|philabs|psivax|trwrb}!ttidca!clark