Re: Einlesen aus Datei > 2GB

David Haller <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Hallo,

Am Thu, 02 Jun 2005, Christian Schneider schrieb:
>Wie lese ich aus Dateien > 2GB bzw. schreibe in diesen? Bei C-Funktionen 
>wird scheinbar nur ein long zur Positionierung verwendet, also ist da 
>auch bei 2GB Schluss?

Du musst dafuer sorgen, dass _LARGEFILE_SOURCE und _FILE_OFFSET_BITS=64
definiert sind. Dann bekommst du deinen 64bittigen off_t und Largefile
faehigen stdio. Ob das mit iostream dann auch geht weiss ich nicht.

==== test_off_t.c ====
#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
int main(void) {
    printf("%i\n", sizeof(off_t));
    return 0;
}
====
$ make test_off_t >/dev/null && ./test_off_t
8

-dnh

-- 
PC's are designed by a committee of people who are in different companies
in different countries and who never talk to each other. -- Derick Siddoway
And nobody speaks the same language and they hate each other... -- Chris Adams

-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfÃŒgbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.