Hi,

Does a file have to be writable in order to be deleted?

If a file is writable using the php is_writable() function does it mean it can also be deleted because it is writable?

Reason for asking is before i attempt to delete a file and record from database i am checking if the file exists using file_exists() and then if file exists checking if it is then is_writable so i can delete the file using unlink();

But not sure if a file that is_writable is also able to be deleted.

Thanks
PHPLOVER

Thank you d5e5,

This helps me allot in giving the user (admin) and appropriate error.

Thanks
PHPLOVER

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.