- or download this
# From /etc/security/limits:
# Sizes are in multiples of 512 byte blocks
...
print $fh $block or die "$i: error in print: $!";
}
close $fh or die "error: close: $!";
- or download this
ulimit -f 900
- or download this
% perl f.pl
ulimit=900 blocks (block size=512)
...
800: 410112 bytes written
900: 461312 bytes written
904: error in print: A file cannot be larger than the value set by uli
+mit. at f.pl line 22.
- or download this
use strict;
use warnings;
...
$size += $bsize; # <-- Moved this line to after successful print
}
close $fh or die "error: close: $!";
- or download this
ulimit=900 blocks (block size=512)
0: 0 bytes written
...
800: 409600 bytes written
900: 460800 bytes written
900: error in print: A file cannot be larger than the value set by uli
+mit. at f.pl line 23.
- or download this
% type ulimit
ulimit is a shell builtin.
...
900
% bash -c 'ulimit -f'
450