Re: fopen
| From: | John Taylor-Johnston | Date: | Sat, 19 Mar 2005 06:09:23 +0000 |
| Subject: | Re: fopen | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211087@lists.php.net to get a copy of this message | ||
P.S., I've checked the doc and tried "a+". It still does not create ffmail.txt.
@ $results = fopen($datafilename, "a+");
# Open for reading and writing; place the file pointer at the end of the file.
#If the file does not exist, attempt to create it
It does not create it.
John
> FOpen question. My script is dying. "Our results file could not be opened for
> writing"
> What can I add to get more info from the die? Do I «have» to specify a pathname in
> $defaultfile?
>
> John
>
> $defaultfile = "ffmail.txt"; #default file to write to
> @ $results = fopen($datafilename, "a"); #open file and supress errors
> #print custom error if file doesn't exist or improper permissions
> if (!$results) { die ("Our results file could not be opened for writing."); }
--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."
' ' ' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- 819-569-2064
°v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures
/(_)\ Université de Sherbrooke
^ ^ http://compcanlit.ca/ T: 819.569.2064