in reply to Re^3: File::Binary:howto goto a position in file
in thread File::Binary:howto goto a position in file

I don't know how good IO::File's docs are, but check these docs (to which I already linked):

The values for WHENCE [which you called OFFSET] are 0 to set the new position in bytes to POSITION, 1 to set it to the current position plus POSITION, and 2 to set it to EOF plus POSITION (typically negative). For WHENCE you may use the constants SEEK_SET , SEEK_CUR , and SEEK_END (start of the file, current position, end of the file) from the Fcntl module. Returns 1 upon success, 0 otherwise.

In other words, the second argument determines whether the first argument is relative to the front of the file, to the current position in the file, or to the end of the file.

  • Comment on Re^4: File::Binary:howto goto a position in file

Replies are listed 'Best First'.
Re^5: File::Binary:howto goto a position in file
by jeanluca (Deacon) on Mar 13, 2006 at 12:34 UTC
    your link to the docs seems to be wrong!! Luca
      Fixed. You could have used the one in my earlier post.