Apparently you didn't
From truncate
Truncates the file opened on FILEHANDLE, or named by EXPR, to the specified length.
Raises an exception if truncate isn't implemented on your system. Returns true if successful, undef on error.
The behavior is undefined if LENGTH is greater than the length of the file.
The position in the file of FILEHANDLE is left unchanged. You may want to call seek before writing to the file.
Portability issues: "truncate" in perlport.
> I tried to write this same code in other languages, and those codes failed too
Probably a problem for Windows XP (!) to handle a Linux FS.
So not really a Perl problem.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re: file truncate not working on 128GB file in Windows
by LanX
in thread file truncate not working on 128GB file in Windows
by harangzsolt33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |