RES: [PHP] How to determine if file is writable and deletable

[email protected] ("Thiago Pojda")
Newsgroups php.general
Message-ID <013b01c8b064$bd3ba500$0201a8c0@softpartech>
If it's not, what else can? I got curious.


Regards,
Thiago Henrique Pojda

-----Mensagem original-----
De: Al [mailto:[email protected]] 
Enviada em: quarta-feira, 7 de maio de 2008 12:25
Para: [email protected]
Assunto: Re: [PHP] How to determine if file is writable and deletable

You are missing the point of my question. I don't have a problem reading the
permissions. They do 
not solely determine whether a file can be deleted.

Aschwin Wesselius wrote:
> 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........
>>
> Hi,
> 
> Maybe this is what you need:
> 
> http://nl.php.net/manual/en/function.fileperms.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.