Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!unisoft!gethen!bdt!david From: david@bdt.UUCP (David Beckemeyer) Newsgroups: comp.sys.atari.st Subject: Re: File handle info Message-ID: <324@bdt.UUCP> Date: 26 May 88 17:35:01 GMT References: <447@ruuinf.UUCP> Reply-To: david@bdt.UUCP (David Beckemeyer) Organization: Beckemeyer Development Tools, Oakland, CA Lines: 29 In article <447@ruuinf.UUCP> piet@ruuinf.UUCP (Piet van Oostrum) writes: >Is there a way to find out what kind of file is connected to a file handle, >e.g. disk file/keyboard/screen. >In some old Atari doc I found F_ioctl, but that doesn't seem to be >implemented. The problems come up when you run a program with stdin/stdout >redirected by a shell. > >-- >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 Micro RTX added this feature to TOS. There are two calls to determine characteristics of a file handle. Here's the simplest way: type = Ftype(fd); The value returned by this call tells you what the handle is: 0-15 The BIOS level device number (e.g. 2=console) 16 A regular file 17 A pipe Maybe a future versiaon of Atari TOS will also support this. -- David Beckemeyer | "Reckon the Ball's plumb open now, Beckemeyer Development Tools | and it's `swing partner'!" 478 Santa Clara Ave, Oakland, CA 94610 | - Unnamed Cowboy, upon seeing UUCP: ...!ihnp4!hoptoad!bdt!david | heap many Indians approaching