Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: fwrite? Message-ID: <10945@jpl-devvax.JPL.NASA.GOV> Date: 7 Jan 91 19:46:13 GMT References: <1991Jan7.144029.12478@robobar.co.uk> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 21 In article <1991Jan7.144029.12478@robobar.co.uk> ronald@robobar.co.uk (Ronald S H Khoo) writes: : Hasn't anyone ever felt the need for an fwrite interface ? : I was looking at a perl clone of (John Haugh ? can't remember)'s : utmp-dead-process reaper, and looks to me that it's not strictly : speaking possible. : : What I mean is, that : : with stdio: can't. no interface to fwrite. : : without stdio: well, there's no guarantee that stdio's fseek : necessarily calls lseek at that moment, so if : it doesn't, then I need a syslseek(). : : Have I got the wrong end of the stick ? Yep. The ordinary Perl print statement calls fwrite(). It pretty much has to, since it might have to write binary data. Just make sure the string is the length you want to fwrite() and then print it. Larry