Andy,

 

According to my O'Reilly reference, under fopen:

For modes "r" and "r+", the file must already exist.

 

I'm surprised that this causes a seg fault, but apparently you are using
the function out of spec.  You may have to open in append mode and then
do an fread from the file to see if it is empty or contains data. My
reference mentions nothing about the file needing to exist to be opened
in append mode, so I assume that if the file doesn't exit, append mode
will create a new one.

Regards,
Steve Preissig

Texas Instruments
Technical Training Organization
9260 Waits Ferry Crossing
Duluth, GA  30097 
[EMAIL PROTECTED] 
(770) 840-0783 

 

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to