APM: changing buffer size to a writable fh
jeremyb at univista.com
Thu May 29 14:00:10 CDT 2003
I had the same feeling... The file is a web document that gets
regenerated every n seconds by the script. I want to make sure that the
current file doesn't get over written by the script writing only
portions of the new data to the file when the buffer is filled...
Basically, I can't have a partial file available on the apache server.
Either the old one or the complete new one must be there.
I'm not sure how much data it would take to cause this. Indeed, this
may not even be an issue if the buffer is large enough.
On Thu, 2003-05-29 at 13:34, Dennis Moore wrote:
> On Thu, May 29, 2003 at 12:29:48PM -0500, jeremy wrote:
> > Hey all,
> > I have a need to change the buffer used when writing to a file handle.
> > The handle to to a flat file. The script dumps data to it. ..no big
> > woop.
> > More specifically, I need to make sure that none of the data gets
> > written to the file until the handle is closed OR until the there is no
> > more data regardless of how much data gets kept in memory. I seem to
> > remember doing this a while back but I don't remember how. Can someone
> > point me in the right direction?
> i have a feeling you're asking the wrong question. what is the purpose of
> this behavior? how would your program know there is no more data? you
> could just store your data in a variable and print when you're ready. you
> could also tie the filehandle. you might also take a look at
> Output::Buffer. it looks like that one uses Tie::Filehandle::Buffer so
> you'd be using tie in the end that way.
More information about the Austin