Path: utzoo!attcan!uunet!vsedev!logan From: logan@vsedev.VSE.COM (James Logan III) Newsgroups: comp.unix.wizards Subject: Re: using System V 'cu' Message-ID: <1244@vsedev.VSE.COM> Date: 18 Nov 88 23:26:07 GMT References: <6808@venera.isi.edu> Reply-To: logan@vsedev.VSE.COM (James Logan III) Organization: VSE Software Development Lab Lines: 67 In article <6808@venera.isi.edu> cracraft@venera.isi.edu (Stuart Cracraft) writes: >How do you slow down cu's file transfer capability (e.g. the tilde-put >command) ?? There are two thing I can think of to try. The first idea is to give the yourself a nice value of 39. Just type nice -39 $SHELL and as soon as you get a prompt, "take" the file. The second idea is to rewrite the "cat" command that cu invokes on the machine that has the original file and put it in a personal bin directory that is listed before /bin and /usr/bin in your $PATH. The following program reads X number of characters, sleeps for several seconds and then writes them to stdout. Put it in a file called "cat.c", then type this at a shell prompt: mkdir $HOME/bin PATH=$HOME/bin:$PATH export PATH make cat cp cat $HOME/bin and you're ready to roll. Let me know how it goes. -Jim ------------- CUT HERE ------------ 8< ------------------------- #include #define BLOCKSIZ 256 #define SLEEPVAL 2 main(argc, argv) int argc; char **argv; { char buf[BLOCKSIZ]; int numread; FILE *infd; if ((infd = fopen(argv[1], "r")) == NULL) { fprintf(stderr, "%s: Can't open ", *argv); perror(argv[1]); exit(1); } while (numread = fread(buf, 1, sizeof(buf), infd)) { if (fwrite(buf, 1, numread, stderr) != numread) { fprintf(stderr, "%s: ", *argv); perror("Write error"); break; } sleep(SLEEPVAL); } fclose(infd); exit(0); } ------------- CUT HERE ------------ 8< ------------------------- -- Jim Logan logan@vsedev.vse.com (703) 892-0002 uucp: ..!uunet!vsedev!logan inet: logan%vsedev.vse.com@uunet.uu.net