- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all !
under linux
I try to write files but the limitation is 2Gb !!!
I saw that ipc compiler accept gnu option and try the options
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
it doesn't seem to run ... it doesn't run !
I think I've forgot something somewhere !
help needed !!!! please
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see whether any details as to whether you are using C or C++. If C I would expect the same defines to work in icc as in gcc. In C++ there is a potential problem with libstdc++. I have not looked at this for some time (18 months?) so perhaps there have been changes there to support big files.
An example of what you are doing would help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It' C++ !!!
example :
int main()
{
boolthe_loop = true;
ofstream _pFile("the_file");
while (the_loop)
_pFile<<"xxxxxxxxxxxxxxxx";
_pFile.close();
return 1;
}
stupid example, but used to see the limit of a file size under linux....
when the run falls down, the size of file is 2Gb !
I compil and link this using icpc, with option flag
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
....
no more ideas .........
or maybe other options exist...
HELP !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If Linux shares some of the same problems as Windoz then for compatibility reasons ofstream will be restricted to use a data structure that is limited to DWORD (or integer). You will have to look into your Linux programmer's guide for something like "Extended file open" whereby the file data structure uses _int64 type of integer. MS tends to append "Ex" as a suffix to the file functions/data structures.
Jim Dempsey
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page