Hi Andrew,

Thanks for your help!

And it has worked. On calucating the file position, "LL" is  necessary.

  just like:
    off_t new_pos = 2LL*1024*1024 + 10LL;

2009/5/23 andrew clarke <[email protected]>

>
>
> On Sun 2009-05-17 17:27:16 UTC+0800, Nicle 
> ([email protected]<ynicle%40gmail.com>)
> wrote:
>
> > I have a file > 2GB, and my job is seeking the file to pos: 2.1G.
> > But, the lseek doesn't work.
>
> Did you get this working? The only thing that springs to mind is the
> O_WRONLY paramater to open() may not allow lseek() to work correctly.
>
> Are you sure you need to use file descriptors? An alternative is to
> use fopen(), then fseeko() or fsetpos(). This is probably more
> portable, too.
>  
>


[Non-text portions of this message have been removed]

Reply via email to