On Tue, Mar 02, 1999 at 09:30:22PM +0000, James wrote:
> # #define LOGFILE /APPHOME/applogfile         /* APPHOME is the actual home
> # directory for the application */
> 
> # remove("LOGFILE");                  /* First remove the old logfile */
> # LogFile = fopen("LOGFILE", "w");

I don't understand why you choose to bother with a call to remove or
unlink at this point.  Any decent C book should list the modes for open
and fopen as well as what they do.  Or simply read 'man fopen(3)'.

w       Truncate the file to zero length or create text file for writing.
        The stream is positioned at the beginning of the file.

The call to remove is unnecessary as the file will be opened for writing
as if it were an empty file.  Use mode "r+" or "a+" to read and write
depending on where you want to start in the file.

-- 
Robert G. Fisher                     NEOCOM Microspecialists Inc. 
System Administrator/Programmer      (540) 666-9533 x 116

Reply via email to