Re: [PHP] What's the proper way to open a file? File access permissions?
Jason Wong wrote: On Friday 14 February 2003 16:36, Dunkel wrote: How do I ensure that all file access permissions are allowed? What is the proper way to do it? - I tried to 'fopen' an existing text file but got "Permission denied" error. - I tried different parameters, same error - I tried to use 'chmode', same thing So, what should I do to get it work? Try using the /fullpath/to/the/file. If you're in doubt about the permissions try writing to the system temp directory (/tmp for example). Okay, thank you. I'll try that. Is there any way to find out the full - whole - path? Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's the proper way to open a file? File access permissions?
On Friday 14 February 2003 16:36, Dunkel wrote: > How do I ensure that all file access permissions are allowed? What is > the proper way to do it? > > - I tried to 'fopen' an existing text file but got "Permission denied" > error. > - I tried different parameters, same error > - I tried to use 'chmode', same thing > > Same thing with different servers so I'm obviously doing something > wrong. Everything else works fine but the writing doesn't. > > The (writing)code is very basic > (the textfile.txt exists before this): > > > $filename = "textfile.txt"; > $somecontent = "the text to add\n"; > $handle = fopen($filename, 'a+w'); > fwrite($handle, $somecontent); > fclose($handle); > > ?> > > So, what should I do to get it work? Try using the /fullpath/to/the/file. If you're in doubt about the permissions try writing to the system temp directory (/tmp for example). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Whatever occurs from love is always beyond good and evil. -- Friedrich Nietzsche */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What's the proper way to open a file? File access permissions?
Hello all! How do I ensure that all file access permissions are allowed? What is the proper way to do it? - I tried to 'fopen' an existing text file but got "Permission denied" error. - I tried different parameters, same error - I tried to use 'chmode', same thing Same thing with different servers so I'm obviously doing something wrong. Everything else works fine but the writing doesn't. The (writing)code is very basic (the textfile.txt exists before this): $filename = "textfile.txt"; $somecontent = "the text to add\n"; $handle = fopen($filename, 'a+w'); fwrite($handle, $somecontent); fclose($handle); ?> So, what should I do to get it work? Yours, Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php