Folks,
I am having problem with fwrite() function. I have written a utility to
convert file from one format to another and I use fwrite() to write to the
file. I get EFBIG error when file reaches 2GB limit. The file system on
which I am writing the file is large file enabled, and ulimit is set to
unlimited.
As further test I tried to create a large file using dd command:
dd if=/dev/zero of=test bs=32k
and I was able to create file larger then 2GB, so the problem is not with
the file system.
Is there any limitation with fwrite()?
Here is the fragment of code:
void SeqWriteRecord(struct WriteInfo *WriteInfo, enum RecordType RecordType,
char *Buffer, int DataSize)
{
int SaveErrno;
if (WriteInfo == NULL)
{
return;
}
WriteHeader(DataSize + 4, RecordType, WriteInfo->FilePtr);
if (fwrite(Buffer, (size_t)1, (size_t)DataSize, WriteInfo->FilePtr)
!= DataSize)
{
SaveErrno = errno;
eFatal(10828, "SeqWriteRecord: Could not write full record of size %d errno = %d", DataSize, SaveErrno);
}
The errno is 27 which ie EFBIG.Quote:}
I need to fix is A.S.A.P.
Thanks is advance.
--
Hemant Shah /"\ ASCII ribbon campaign
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.