Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mailrus!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR/KT) Newsgroups: comp.lang.perl Subject: Re: (f)flush? Message-ID: <1990Aug4.191307.10807@NCoast.ORG> Date: 4 Aug 90 19:13:07 GMT References: <8936@jpl-devvax.JPL.NASA.GOV> <1990Aug2.225410.2587@NCoast.ORG> <8992@jpl-devvax.JPL.NASA.GOV> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR/KT) Followup-To: comp.lang.perl Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 43 As quoted from <8992@jpl-devvax.JPL.NASA.GOV> by lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall): +--------------- | out in the I/O structure--look at IOF_FLUSH in stab.h. When you refer to | the $| varialbe, it's referring to that flag for the currently selected | output filehandle, and not to the flag for any other filehandle. +--------------- Eek. I don't select filehandles, I refer to them explicitly. Oh, well. +--------------- | Depends on your implementation of STDIO, and what kind of thing you're writing | to. Turning off $| merely makes it not do flushes. If it was unbuffered | before, having $| on doesn't help you, and if it was buffered before, turning | $| off won't make stdio unbuffered. On most systems, output to (raw) tape and | disks is buffered. +--------------- But stdio buffers at something between 512 bytes and 8K by default, depending on the implementation. On the machines I use, it's 1K; that's a far cry from 512K blocks on a tape drive.... +--------------- | $| is not a global, and it has nothing to do with setbuf. +--------------- I should have said setvbuf; I want user-specified block sizes, not just stdio's fixed block size. And stdio buffered output has to do with setvbuf, and $| controls buffering. (Although, from how you described $|, it's not particularly useful for this purpose.) +--------------- | On machines with syscall(), you can get around dumb stdio limitations using | it. It might be worthwhile for me to add a sysread() and syswrite() | builtin to bypass stdio. +--------------- SVR3.1, at least, doesn't have syscall. I don't think 3.2 has it, either. ++Brandon -- Me: Brandon S. Allbery VHF: KB8JRR/KT on 220 (soon others) Internet: allbery@NCoast.ORG Delphi: ALLBERY uunet!usenet.ins.cwru.edu!ncoast!allbery America OnLine: KB8JRR