Re: [PHP] What's the proper way to open a file? File access permissions?

2003-02-17 Thread Dunkel


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




[PHP] What's the proper way to open a file? File access permissions?

2003-02-14 Thread Dunkel
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):

   ?php

   $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



Re: [PHP] Re: File not rewritable - why? Help needed.

2003-02-12 Thread Paul Dunkel
Marek Kilimajer wrote:

use
chmod 755 directory
on each directory that is in the way to your file



I tried that, too. Didn't help.

Here is the code, stripped to the original, straight from the tutorial. 
And I can't get it work. What's wrong here?


$somecontent =  'PERKELE\n';
$filename = 'teksti.txt';
$handle = fopen($filename, 'wb');
fwrite($handle, $somecontent);
fclose($handle);

I've tried this in two totally different servers, tomorrow I'll try on 
the third one.

All help absolutely welcome!

Paul Dunkel
--
pdunkel.nic.fi


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Q: file writing problem - help desperately needed

2003-02-12 Thread Dunkel
Newbie question:

I try to modify a txt-file but get not writable error.
(just like in http://www.php.net/manual/en/function.fwrite.php )

Here is the code, stripped to the original, straight from the tutorial. 
And I can't get it work. What's wrong here?

	$somecontent =  'PERKELE\n';
	$filename = 'teksti.txt';
	$handle = fopen($filename, 'wb');
	fwrite($handle, $somecontent);
	fclose($handle);

I've tried this in two totally different servers, today I'll try on the 
third one.

All help absolutely welcome!

Paul Dunkel
--
pdunkel.nic.fi


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php