Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!rutgers!att!ihlpe!opus From: opus@ihlpe.ATT.COM (452is-Kim) Newsgroups: comp.unix.wizards Subject: Re: shell file descriptor programming (was: Unlinked temp files) Summary: rewind with ksh Message-ID: <4763@ihlpe.ATT.COM> Date: 3 May 89 16:25:56 GMT References: <871@marvin.Solbourne.COM> <1015@philmds.UUCP> <296@tree.UUCP> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 30 In article <296@tree.UUCP>, stever@tree.UUCP (Steve Rudek) writes: : In article <10944@bloom-beacon.MIT.EDU>, scs@adam.pika.mit.edu (Steve Summit) writes: : : extern long int atol(); : : main(argc, argv) int argc; char *argv[]; : : {lseek(atoi(argv[1]), atol(argv[2]), atoi(argv[3]);} : : Neither works under the ksh (Microport System V/AT 2.4) though both work : under the bourne shell (tested with the shell script). The ksh failure is : absolutely silent. : : ---------- : Steve Rudek {ucbvax!ucdavis!csusac OR ames!pacbell!sactoh0} !tree!stever I had the same problem when I tried it, but I figured out a solution: extern long lseek(); main() { return(lseek(0, 0L, 0)); } To use this program to rewind file descriptor 4, for example, you say: rewind <&4 I know it's not clean, but it works. I suppose you could have a shell script front end that takes an actual argument instead of a redirection. -- RoBiN G. KiM ...att!ihlpe!opus