EDIT: I was mistaken, this has nothing to do with Perl, see my reply to Anonymous Monk below.
Here's a sample perl code:
system("rm -f x; ulimit -f 5; while [ 1 ]; do echo 1 >>x; done");
If I run this on Redhat EL6 (perl 5.10.1), I get a file that's 2560 bytes long. If I run it on Redhat EL5 (perl 5.8.8), I get a file that's 5120 bytes long.
If I run the command in the shell as opposed to via perl, I get a 5120 byte file on both platforms, on both sh and bash (I do know sh is a symbolic link to bash here, but figured it's worth a try since you can base behaviour on $0). This is consistent with bash ulimit documentation which states that blocks for -f are 1024 bytes long.
The really weird thing is I managed to call the 5.8 perl from RHEL5 on my RHEL6 system and it still made a 2560 byte file, so it's not dependent on the perl configuration.
So I am at a complete loss. I'd like to know:
- What causes the different behavior?
- How can I avoid it and have perl make a 5120 byte file in all cases?
Thank you very much.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.