RE: [PHP-WIN] fopen()

From: Date: Thu, 21 Feb 2002 13:50:34 +0000
Subject: RE: [PHP-WIN] fopen()
Groups: php.windows 
Request: Send a blank email to php-windows+get-12185@lists.php.net to get a copy of this message
>I have problem with function fopen() - if file not exists, fopen() don't >return false, it returnnothing. It is impossible for a function in a typed language to return different data types dependent on the evaluation of the function. According to the manual pages of php's fiopen() it should return an integer value. The php manual says about fopen: Description int fopen ( string filename, string mode [, int use_include_path]) I assume php calls fopen() from the C-library (with some preparing of the arguments). C's fopen() returns a handler (e.g. an int, a.k.a. integer) to a file. If the file could not be open the "handler" returned will be zero (0) - according to the ANSI C std lib spec. I assume that php's fopen() just forwards this handler, and in case a of failure to open a file, the value returned by fopen() will be, most likely be, zero.

« previous php.windows (#12185) next »