Bluehost.com Web Hosting $6.95

How to determine if file is writable and deletable

This is a discussion on How to determine if file is writable and deletable within the PHP General forums, part of the PHP Programming Forums category; On Sun, 2008-05-11 at 18:09 -0400, Al wrote: > I ended up using posix_access() which is what ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 05-12-2008
Robert Cummings
 
Posts: n/a
Default Re: [PHP] Re: How to determine if file is writable and deletable


On Sun, 2008-05-11 at 18:09 -0400, Al wrote:
> I ended up using posix_access() which is what is_writeable() should be. is_writeable() is virtually
> useless.


So you're saying is_writeable() shouldn't work on Windows systems? :p
Seems you want is_writeable() to sing AND dance... perhaps too much
expecting.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

Reply With Quote
  #12 (permalink)  
Old 05-12-2008
Shawn McKenzie
 
Posts: n/a
Default Re: How to determine if file is writable and deletable

Al wrote:
> I ended up using posix_access() which is what is_writeable() should be.
> is_writeable() is virtually useless.
>
> 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........

Not if you read Robin's post.

-Shawn
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:25 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0