Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: limit output filesize

by Forsaken (Friar)
on Jul 09, 2005 at 05:37 UTC ( [id://473643]=note: print w/replies, xml ) Need Help??


in reply to limit output filesize

i'm anything but an expert, but I would likely go for a solution where I used a single scalar to keep track of how many bytes were already written, and before each write check if ($bytes_written + $current_line) > 51200. If that's the case, hang on to $currentline for the moment, close the file I was writing to nice and tidy and open the next one. Might be tedious, but it's simple :-) Not sure how efficient it would be though.


Remember rule one...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://473643]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-20 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found