Re: Splitting an output file based on it's size (UNIX)
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > Re: Splitting an output file based on it's size (UNIX)




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Splitting an output file based on it's size (UNIX)  
Jeremiah DeWitt Weiner


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-16-06 10:53 PM

cgw_jlw@tiscali.co.uk wrote:
> I've never come across this before, but lo-and-behold, "ulimit -f" can
> be used to set a maximum filesize.
> I don't see how you can trap the event where the filesize exceeds it's
> maximum and point output elsewhere, sorry.

A process which exceeds its maximum filesize gets SIGXFSZ, so you
could trap that and use a signal handler to say "close the existing file
and open a new one".  I don't think the OP said exactly what his program
was doing, so it's hard to know whether the problem is best handled this
way or at another organizational/structural/syntactical level.  For
example, maybe the output could go to standard out and get piped into
'split' instead.

--
Oh to have a lodge in some vast wilderness.  Where rumors of oppression
and deceit, of unsuccessful and successful wars may never reach me
anymore.
-- William Cowper





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register