note 13398 deleted from function.rewind by jimw

From: Date: Tue, 18 Dec 2001 22:47:17 +0000
Subject: note 13398 deleted from function.rewind by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23287@lists.php.net to get a copy of this message
Quick and dirty way to overcome the rewind/append problem: $fp = @fopen( $filename, 'r+' ); if( ! $fp ) $fp = fopen( $filename, 'w+' ); fseek( $fp, 0, SEEK_END ); Will open for read/write and FAIL if file does not exist. Will open for read/write/create in this case. Filepointer is set to EOF to emulate the append mode.

« previous php.notes (#23287) next »