cURL / Mailing Lists / curl-users / Single Mail

curl-users

fseek() and large files

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 7 Mar 2005 08:58:50 +0100 (CET)

Hi!

Dan, you modified the fseek() in src/main.c:3779 the other day from

   fseek(outs.stream, 0, SEEK_END);

to

   fseek(outs.stream, outs.init, SEEK_SET);

Was there a specific reason for this?

Since 'outs.init' is potentially a 64 bit file size and fseek() takes a
'long', this will break when reaching beyond 2GB...

See for example this warning:

         http://curl.haxx.se/auto/log.cgi?id=20050307072208-32314#prob1

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-03-07