in reply to file truncate not working on 128GB file in Windows

Hard to tell...

Apparently you didn't

From truncate

> 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

  • Comment on Re: file truncate not working on 128GB file in Windows

Replies are listed 'Best First'.
Re^2: file truncate not working on 128GB file in Windows
by bliako (Abbot) on Feb 06, 2024 at 11:17 UTC
    ... to handle a Linux FS.

    it's just a binary file

Re^2: file truncate not working on 128GB file in Windows
by harangzsolt33 (Deacon) on Feb 06, 2024 at 05:47 UTC
    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...
      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