Reputation: 40157
My plugin needs to be able to write to the file system. Is it possible to query a known file for write permissions?
For example, my wordpress theme ships with a file called custom.css that i need write access to. When my theme first loads, I'd like to query this script to see if its writable, then echo the results to my theme.
Then in support session's, I can ask the user to visually check this setting to insure I have write permissions as expected (and eliminate that as the cause of a read/write issue).
Upvotes: 2
Views: 518
Reputation: 1762
I'm probably way too late for this but there is "is_writable"
http://php.net/manual/en/function.is-writable.php
Upvotes: 2
Reputation: 163272
is_writable("yourfilename.txt")
http://php.net/manual/en/function.is-writable.php
For example...
if (is_writable('custom.css')) {
echo "Success! custom.css is writable";
} else {
echo "Failure!! custom.css is not writable";
}
Upvotes: 6