Re: fopen

From: Date: Mon, 29 Dec 2003 14:50:58 +0000
Subject: Re: fopen
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-173426@lists.php.net to get a copy of this message
Now it gives me the following error message: Warning: fopen(websitename/esp/files/welcome.txt): failed to open stream: No such file or directory in d:\wwwroot\websitename\esp\lib\functions.php on line 6 But the file exists and so does the folder it is into. What can be wrong? I also uploaded the file to my Unix web server for testing purposes, CHMOD the folder to 777 and linked to the file but then other error appeared. When I tried with "rb" for fopen it gave me the same error saying that the file was missing... ??? Thanks, "Gerard Samuel" <php-general@trini0.org> escribió en el mensaje news:200312290120.14608.php-general@trini0.org... > On Sunday 28 December 2003 11:17 pm, Cesar Aracena wrote: > > $fp = fopen("../files/welcome.txt", "a+"); > > > > Change to > $fp = fopen("../files/welcome.txt", "r"); > > Use "r" to read, when you use "a" it appends (or adds) to the file > Its also suggested to use the "b" option to so it would look like > $fp = fopen("../files/welcome.txt", "rb"); > > That is done for portability between *nix and windows. > > More info is at the manual > http://us2.php.net/manual/en/function.fopen.php

« previous php.general (#173426) next »