PHP
From Blue-IT.org Wiki
Test, if a file can be written to directory
<?php $handle = fopen("/tmp/test.txt", "x"); if ($handle) echo "Success!"; else print_r(error_get_last()); ?>
<?php $handle = fopen("/tmp/test.txt", "x"); if ($handle) echo "Success!"; else print_r(error_get_last()); ?>