problems with rename() - permission denied

From: Date: Tue, 25 Mar 2003 10:21:05 +0000
Subject: problems with rename() - permission denied
Groups: php.general 
Request: Send a blank email to php-general+get-140929@lists.php.net to get a copy of this message
Hello, I've a small problem, which mades me crazy... :\ I'm trying to rename() a swapfile to real destination file (atomic update). It works on differnt environments very well. Sadly not on my ISP-server I've added an "chmod($swapfile,0777)", but this has not solve the problem. The directories have all FULL access (read, write, etc.). The destiniation file too. I don't want 2 use the copy/unlink solution.... Do anyone have an idea? --- 8< --- if ( $file = fopen($swapfile,"w") ) { fwrite($file,$out); fclose($file); chmod($swapfile, 0777); /* this fails with "Permission denied" */ rename($swapfile,$filename); /* ... but this works */ copy($swapfile,$filename); unlink($swapfile); } --- 8< ---- Thanks 4 help... -- christian rosentreter

« previous php.general (#140929) next »