Re: How to determine if file is writable and deletable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 11:16 AM -0400 5/7/08, Al wrote:
I need to determine if a file is truly deletable by a php script, Deleting permissions seem to be the same as writing, they probably have the same criteria.

is_writable() seems to virtually useless in most cases. It doesn't take into account the directory ownership/permissions; which, best I can tell, is the real determining factor.

I've resorted to having to determine the directory's ownership and then compare the directory's rights with the owner's and then the other ['world'].

E.g., Assume my script was loaded with ftp, so it's ownership is the site-name, and I want the scrip to be able to determine if it can delete a file. Thus, the file in question must have its "other" permissions include write.

Surely, there must be an easier way.

Thanks, Al........


Perhaps touch might help.

http://nl.php.net/manual/en/function.touch.php

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux