|
-
Aug 26th, 2007, 07:22 AM
#1
Thread Starter
transcendental analytic
reading big files
How can i read files using 64 bit file pointer in linux?
Thanks.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 26th, 2007, 11:28 AM
#2
Re: reading big files
I think that some more recent versions of the kernel/libc should support large files inherently... otherwise you will need to use the large file interface:
pass O_LARGEFILE to open() -- see man 2 open and man 5 lf64.
Hope this helps.
Edit: actually, it might be simpler than that -- write as normal using a FILE*, fopen(), etc; include:
Code:
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
(or pass -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 to gcc)
Last edited by sunburnt; Aug 26th, 2007 at 11:40 AM.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|