All of lore.kernel.org
 help / color / mirror / Atom feed
From: "William N. Zanatta" <william@veritel.com.br>
To: Thomas Ackermann <Thomas.Ackermann@eWave.at>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: having probs with files > 2G
Date: Fri, 24 May 2002 12:14:06 -0300	[thread overview]
Message-ID: <3CEE58BE.2030600@veritel.com.br> (raw)
In-Reply-To: 3CEE5113.1000702@eWave.at

Thomas Ackermann wrote:
> hi!
> i hope i'm not off topic with this, but, i'having problems with some 
> split-like program i'm writing at the moment.
> 
> when opening files > 2GB the program freezes when data is read from the 
> file the first time.
> had it already working before with a buffer size of (char)1 before but 
> that went really slow..
> 
> source code is attached, please help..
> 
> thx, thomas
> 
> 

You should use
   unsigned long long int var;

and

   the %llu modifier in your printf's and stuffs like that...

This illustrates your problem...
------------------------[ cut here ]---------------------------
#include <stdio.h>

int main() {


   unsigned long long int x = 0;
   unsigned int y = 0;
   x--;
   y--;

   printf("New Limit:    [%llu]\nActual Limit: [%u]\n", x,y/2);

   return(0);
}
------------------------[ cut here ]---------------------------

Of course you MUST NOT rely only in the %ull limit as you also have a 
limit in the filesystem but if you know how to deal with it, you will 
get everything working fine. =]

William

-- 
Perl combines all of the worst aspects of BASIC, C and line noise.
                 -- Keith Packard


      reply	other threads:[~2002-05-24 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24 14:41 having probs with files > 2G Thomas Ackermann
2002-05-24 15:14 ` William N. Zanatta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CEE58BE.2030600@veritel.com.br \
    --to=william@veritel.com.br \
    --cc=Thomas.Ackermann@eWave.at \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.