The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Creating an sql statement from a file. Problem with ' hannem Shell Programming and Scripting 2 04-24-2008 08:26 AM
creating new files montana77 UNIX for Dummies Questions & Answers 4 04-13-2008 02:20 AM
Finding files with names that have a real number greater then difined. harmonwood Shell Programming and Scripting 2 11-09-2007 10:28 AM
Problem with creating big files eliraza6 Linux 6 11-06-2007 09:54 AM
Deleting specific files greater then 90 days beilstwh Shell Programming and Scripting 2 07-22-2004 03:27 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-17-2007
bobbyjohnz bobbyjohnz is offline
Registered User
  
 

Join Date: May 2005
Posts: 19
Problem creating files greater than 2GB

With the C code I am able to create files greater than 2GB if I use the 64 bit compile option -D_FILE_OFFSET_BITS=64. There I am using the function fprintf to write into the file. But when I use C++ and ofstream the file is getting truncated when the size grows beyond 2GB. Is there any special compile option needed to overcome this?

My OS is - SunOS 5.8
  #2 (permalink)  
Old 01-17-2007
hegemaro hegemaro is offline
Registered User
  
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 134
With the GNU gcc compiler, specifying the "-m64" option generates code for the 64-bit environment which includes 8-bytes for a file offset. I normally use low-level I/O with which you can specify the O_LARGEFILE status flag when working in a 32-bit environment.

In short, try compiling with the -m64 option.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0