in reply to Problem truncating a huge file

Are you sure that you want to truncate the file to 778275853 bytes?

What size is the file that you are trying to truncate? Is it greater than 7782756853 bytes?

What OS?

Did you use the following?
use Fnctl ':flock';
If so, you might try:
use Fnctl;

Update: I seem to have left out the most important question... What is the actual issue that you are having?

Replies are listed 'Best First'.
Re^2: Problem truncating a huge file
by abhishek_akj (Initiate) on Aug 27, 2009 at 11:39 UTC
    Yes , the file is larger than 7782756853 bytes. OS: FreeBSD The actual issue is that I want to remove the last line of a very large file, thats all. For that I used File::ReadBackwards, got the pointer position for the start of last line, and wanted to truncate from that. If so, you might try: use Fnctl; How would this help?

      I have seen reports of truncate failing when use Fnctl ':flock' was used but that changing it to use Fnctl; allowed it succeed. *shrug*

        I AM using use Fnctl ':flock :seek :DEFAULT'; but if I use just use Fnctl; would it not mean I have to replace all instances of LOCK_** with their respective numeric constants?