in reply to How do I pre-extend a file to a specified size
truncate just sets the filesize of the file opened by handle to whatever you specify; you can use it to remove characters from file as well as increase the filesize.open FILEHANDLE, " +< filename" or die "Unable to open: $! \n"; truncate FILEHANDLE, $desired_length or print "Unable to truncate: $ +! \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How do I pre-extend a file to a specified size
by Mr. Muskrat (Canon) on Aug 26, 2009 at 17:29 UTC |