Problem with LZSeek()

Posted on 2004-11-18
Last Modified: 2013-11-20
Hi experts
                I open a file using LZOpenFile(). let file size is greater than 5gb. File is  an image of a drive. using  LZSeek( INT hFile,LONG lOffset,INT iOrigin), we can't seek to an offset which exceed the long value. Is there any way to seek any offset? Let my file size is 8gb. and i want to read file's contents which are at 7gb and i want to use LZSeek as
     LZSeek(filehandle, offset,origin=beginning of file)
 where offset should be value around 7gb.
Question by:ManojKrChauhan
    LVL 13

    Accepted Solution

    You already ar eaware of the fact that 4GB is the limit to store in a LONG. So the only way I see is to use LZSeek twice (or mutilple times)

    LZSeek (filehandle, 4GB, 0); //start at file beginning and go as far as possible
    LZSeek (filehandle, 1GB, 1); //resume at current position and seek the remainder.
    LVL 16

    Expert Comment


    Author Comment

    Thanks Experts
                       LZSeek() can be use twice or many times. But if a hard disk is of more than 200GB then a lot of problem. It's good suggestion but i want a way by which i can use LZSeek() only once.

     As _lseek() has another function
     __int64 _lseeki64( int fd, __int64 offset, int origin );

     Is there no function(i64) for LZSeek()?

    SetFilePointer() is the best option. But it takes first parameter as HANDLE(of opened/created file). while LZOpenFile() returns an INT value. So i can't use SetFilePointer() here.
    Thanks for reply. If is there any way then please reply.
    LVL 13

    Expert Comment

    Maybe wait for IA64 or AMD46 compatible windows? ;-)
    If you know the file size and the desired offset it might be worth to search from the end of the file.

    Can't find any clue on length of parameters for a call to LZSeek at

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
    Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now