Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pacbell!sactoh0!tree!stever From: stever@tree.UUCP (Steve Rudek) Newsgroups: comp.unix.wizards Subject: Re: shell file descriptor programming (was: Unlinked temp files) Summary: 'rewind' and 'lseek' don't work with ksh Message-ID: <296@tree.UUCP> Date: 2 May 89 01:15:41 GMT References: <871@marvin.Solbourne.COM> <1015@philmds.UUCP> <10944@bloom-beacon.MIT.EDU> Organization: TREE BBS (916)-349-0385 Sacramento, Ca Lines: 21 In article <10944@bloom-beacon.MIT.EDU>, scs@adam.pika.mit.edu (Steve Summit) writes: > In article <1015@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes: > >main(argc,argv) int argc; char **argv; { lseek(atoi(argv[1]),0L,0); } > be more general and write lseek(1) instead of rewind(1S): > 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. Obviously the ksh isn't 100% compatible (I've also noticed that function recursion which works under sh fails under ksh--but at least it has the decency to complain). Is this sort of file rewind impossible under ksh? Any guesses as to why the ksh falls down? Other significant upward incompatabilities? -- ---------- Steve Rudek {ucbvax!ucdavis!csusac OR ames!pacbell!sactoh0} !tree!stever