Re: N00b question: creating files

From: Pjotr Wedersteers (x33159_at_westerterp.com)
Date: 07/05/04


Date: Mon, 5 Jul 2004 01:33:33 +0200


"Garp" <garp7@no7.blueyonder.co.uk> wrote in message
news:fN%Fc.4179$Hj1.36076737@news-text.cableinet.net...
>
> "Tom Thackrey" <use.signature@nospam.com> wrote in message
> news:YB%Fc.87596$gb6.19214@newssvr29.news.prodigy.com...
> >
> >
> > On 4-Jul-2004, "Pjotr Wedersteers" <x33159@westerterp.com> wrote:
> >
> > > Warning: fopen(logfiles\log1.txt): failed to open stream: Permission
> > > denied
> > > in script1.php on line 142
> >
> > try fopen('logfiles/log1.txt','w');
> >
> > backslash is an escape. Assuming the your filename was in quotes it
would
> be
> > interpreted as logfileslog1.txt, probably not what you want.
> >
> > fopen also requires the mode as the second parameter. 'w' for write, 'a'
> for
> > append, etc
> >
> > http://www.php.net/manual/en/function.fopen.php
>
> Your web server user needs write access to the folder you're trying to
> create in, too. Check at the console. And post source that doesn't work so
> we can see if there are obvious problems.
>
What a silly mistake of me to use the wrong windoze backslashes. SIGH. But
it works now, thanks for the pointers. Rights have been properly assigned
now, webuser has rw rights to the directory.

Back to the development table to further exploit that fine PHP! I like it
sofar!
Pjotr



Relevant Pages

  • Re: using Context.Parameters["INSTALLDIR"],
    ... It adds a backslash in a way so that it doesn't get misinterpreted as a C ... This posting is provided "AS IS" with no warranties, and confers no rights. ... >> David Guyer - VBQA Deployment Testing ...
    (microsoft.public.dotnet.framework.setup)
  • Re: append character
    ... I guess the intent is to append a \ on the end. ... As there is the problem, how different compilers handle the backslash, ... Actually, yes, even on "non-ASCII systems" because achar ...
    (comp.lang.fortran)
  • Re: append character
    ... I guess the intent is to append a \ on the end. ... As there is the problem, how different compilers handle the backslash, ... The OP's original solution is portable. ...
    (comp.lang.fortran)
  • Re: using Context.Parameters["INSTALLDIR"],
    ... what is that last backslash good for? ... > David Guyer - VBQA Deployment Testing ... rights. ...
    (microsoft.public.dotnet.framework.setup)
  • Re: append character
    ... I guess the intent is to append a \ on the end. ... As there is the problem, how different compilers handle the backslash, ...
    (comp.lang.fortran)