Re: Creating Files Windows vs Unix
| From: | Christian Reiniger | Date: | Thu, 15 Mar 2001 12:54:20 +0000 |
| Subject: | Re: Creating Files Windows vs Unix | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44019@lists.php.net to get a copy of this message | ||
On Thursday 15 March 2001 07:50, you wrote:
> file. In qa.php3 I have the following line which seems to create a file
> if it does not exist:
> $answerFile = "$questionFileName-A.txt"; Then I go along and open this
> later with $wa=fopen("$answerFile","a");
> In problem shooting I tried uploading a blank file with the name
> $questionFileName-A.txt and it worked just fine after that, but that
> will not work for my long term goals On my home computer with win98,
Ok, Assuming that your school server is an *nix system I think I know the
solution.
Apparently fopen () works fine if you just append to an existing file,
but fails if it has to create a new file. So - do you have write
permissions for the directory you place the file in (creating a file
means modifying (i.e. writing to) the directory) ?
> To get around this, I supose I need a few lines of code that first test
> if my file exist and then if it doesn't I will have to create it using
> the touch command?? Any other ideas?
If I'm right this won't work as well.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
Pretty cool, the kind of power information technology puts in our hands
these days.
- Securityfocus on probing 36000000 hosts for known problems in 3 weeks