arfa Posted December 28, 2006 Share Posted December 28, 2006 A standard file write routine - generating the file $fname on the first run.[code=php:0]$fh = fopen($fname, 'w');fwrite($fh,$data);fclose($fh);[/code]On the current server the file, $fname, is written with permission and status:-rw-r--r-- www-dataSo... trying to later write to the file doesn't work.Being www-data it resists standard fTP chmod command.It also fails:chmod("$fname", 0666);Any suggestions or comments here would be most welcome.thanks Quote Link to comment Share on other sites More sharing options...
matto Posted December 28, 2006 Share Posted December 28, 2006 [quote]So... trying to later write to the file doesn't work.[/quote]what error do you get when trying to write to the file the second time? Quote Link to comment Share on other sites More sharing options...
naeembhatti Posted December 28, 2006 Share Posted December 28, 2006 try to use this [code]fopen("/home/rasmus/file.gif", "wb");[/code] Quote Link to comment Share on other sites More sharing options...
arfa Posted December 28, 2006 Author Share Posted December 28, 2006 thanks for the replies.A bit more testing and it seems we are writing.The problem still remains with chmoding - via my FTP prog - error message= Operation not permitted. May not be supported on remote site. Or,via PHP using: chmod("$fname", 0666); Quote Link to comment Share on other sites More sharing options...
arfa Posted December 28, 2006 Author Share Posted December 28, 2006 ooops, hit the post button....rasmus/file.gif", "wb");I am definitely not on a win server (but should get into the 'portability' habit)via my PHP chmod script using: chmod("$fname", 0666);I was getting:Warning: chmod() [function.chmod]: Operation not permitted in /home/ftp/.../....../..but now see that this is only for directories.This thread is a bit of a space waster - other than forcing me to write out my process, and examine the various steps and presumptions along the way - AND learn as a result.sorry about thatthanks for your tolerance Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.