in reply to Re: file truncate not working on 128GB file in Windows
in thread file truncate not working on 128GB file in Windows

That explains something. I didn't realize that truncate returns undef if it fails. I thought it was supposed to return a zero or empty string. Oh, well, it's in the manual. Doh! Why didn't I see that? Anyway, I thought that was weird. I wonder what's the limit where truncate will not fail. I know that earlier versions of Windows XP before Service Pack 2 had a limitation of 120GB. They couldn't access physical storage space above the 120gb limit, which is also really unexplainable. weird. Well, I think, it's time for me to transition to Linux. I've used Windows all my life, but it's becoming increasingly uncomfortable and I have to live with so many limitations...
  • Comment on Re^2: file truncate not working on 128GB file in Windows

Replies are listed 'Best First'.
Re^3: file truncate not working on 128GB file in Windows
by LanX (Saint) on Feb 07, 2024 at 04:21 UTC
    Did you see perlport#truncate ?

    > (Win32) If a FILEHANDLE is supplied, it must be writable and opened in append mode (i.e., use open(my $fh, '>>', 'filename') or sysopen(my $fh, ..., O_APPEND|O_RDWR). If a filename is supplied, it should not be held open elsewhere.

    Probably that's an indication what's going wrong with TinyPerl. And are you sure the file isn't opened otherwise?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery