In Linux:
PolettiX:~# dd if=/dev/zero of=testfile bs=1024 count=1024
1024+0 records in
1024+0 records out
1048576 bytes transferred in 0.019164 seconds (54715967 bytes/sec)
PolettiX:~#
PolettiX:~#
PolettiX:~# mkfs.ext2 testfile
mke2fs 1.37 (21-Mar-2005)
testfile is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
PolettiX:~#
PolettiX:~#
PolettiX:~# mount testfile -o loop /mnt
Now you have a filesystem that will be easy to fill up:
#!/usr/bin/perl
use strict;
use warnings;
use Fatal qw( open close );
chdir '/mnt';
{
open my $fh, '>', 'prova.dat';
print {$fh} "ciao\n" for 1 .. 1000000;
# close $fh;
}
print {*STDERR} "should be closed here!\n";
In my system, the final string on STDERR gets printed when the close above is commented; uncommenting the close triggers the fatal error:
Can't close(GLOB(0x814cd4c)): No space left on device at (eval 2) line
+ 3
main::__ANON__('GLOB(0x814cd4c)') called at ./prova.pl line 13
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
Don't fool yourself.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.