Permission denied
Posted: Tue Sep 26, 2006 8:48 am
feyd | Please use
... be passed , and then it returns me this error:
fopen("c:\Korisnici\Domains\myDomain.ba\ROOT\Inetpub\wwwroot\new\WS/test/txt/kunde2.txt", "w") - Permission denied
Here is the function:
Note that i found $filename ok,as i tested it with "fread".
Please give me some advice.
Thanks in advance.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi ,i am trying to create a simple function for creating/updating text files. It just can't open the ile with the writing permissions. I don't understand
how canCode: Select all
if (is_writable($filename)) { //ok!
}fopen("c:\Korisnici\Domains\myDomain.ba\ROOT\Inetpub\wwwroot\new\WS/test/txt/kunde2.txt", "w") - Permission denied
Here is the function:
Code: Select all
function putDataToFile($filename, $data, $writeAttributes='a') {
$filename = realpath("../../WS/") . "/" .$filename;
if (is_writable($filename)) {
if (!$handle = fopen($filename, $writeAttributes)) {
return "Cannot open file ($filename)";
}
// Write $data to our opened file.
if (fwrite($handle, $data) === FALSE) {
return "Cannot write to file ($filename)";
}
return "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
}else {
return "The file $filename is not writable";
}
}Please give me some advice.
Thanks in advance.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]