Alex Rivera | Logout

How do I check if a directory is writeable in PHP?

Asked 2008-09-20T20:07:38.657
67

Does anyone know how I can check to see if a directory is writeable in PHP?

The function is_writable doesn't work for folders.

Edit: It does work. See the accepted answer.

Edit
Report

1 Answer

4

According to the documentation for is_writable, it should just work - but you said "folder", so this could be a Windows issue. The comments suggest a workaround.

(A rushed reading earlier made me think that trailing slashes were important, but that turned out to be specific to this work around).

answered 2008-09-20T20:10:17.587

Your Answer