Subject: Re: A strage problem with stdio.
To: Koh Sato <k-sato@ks-s.otaru-uc.ac.jp>
From: Todd Vierling <tv@wasabisystems.com>
List: netbsd-help
Date: 12/22/2000 14:02:18
On Sat, 23 Dec 2000, Koh Sato wrote:
: I would appreciate if someone gives me a confirmation that it is
: possible to lseek() back the standard output when it is redirected to a
: (trivial) file.
Yes, you can.
When you use simple redirection on stdin or stdout with a plain file as the
target, it's identical to as if you had open()ed the file by hand inside the
program. The only difference may be whether O_RDONLY or O_WRONLY is
selected based on the < or >. Therefore, such a redirection can be used
with lseek() or even stdio's fseek().
--
-- Todd Vierling <tv@wasabisystems.com> * Wasabi NetBSD: Run with it.
-- NetBSD 1.5 now available on CD-ROM -- http://www.wasabisystems.com/