Path: utzoo!attcan!uunet!mcvax!ruuinf!piet From: piet@ruuinf.UUCP (Piet van Oostrum) Newsgroups: comp.sys.atari.st Subject: Re: File handle info Message-ID: <465@ruuinf.UUCP> Date: 30 May 88 08:56:49 GMT References: <447@ruuinf.UUCP> <324@bdt.UUCP> Organization: Univ of Utrecht, Dept of CS Lines: 18 In-reply-to: david@bdt.UUCP's message of 26 May 88 17:35:01 GMT Posting-Front-End: GNU Emacs 18.47.9 of Mon Mar 21 1988 on ruuinf (hcx/ux) I got a few mail replies on my question regarding where a file resides. Some experimenting and combining the answers gave me a simple way to find out if a file is on disk or a `terminal': what I think is the easiest way to do it: if you seek to an illegal position (like -1), you get an error (-64) if the file is on disk, otherwise you get 0. If the file is on disk, its position is not changed, so the operation is effectively always a no-op. So I use: isatty (fd) int fd; { return (Fseek (-1L, fd, 0) == 0); } Please could any of the TOS developers comment on this? -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands Telephone: +31-30-531806 UUCP: ...!mcvax!ruuinf!piet