Thank's for the pointer, I'm not sure that's what's happening though:
I made a simple test script:
// Create a new file and put some text in it.
$newFile = "new.txt";
@unlink($newFile);
file_put_contents($newFile, "random text");
// Array of files to look at
$files = array("existing file.txt", $newFile);
foreach ($files as $thisFile) {
echo "$thisFile:\n";
var_dump(is_readable($thisFile));
var_dump(file_get_contents($thisFile))."\n";
require($thisFile);
echo "\n\n";
}
Here I test a file I created in Windows, as well as a file created by the script itself, the output is below:
existing file.txt:
bool(false)
string(36) "some random text I typed in earlier."
some random text I typed in earlier.
new.txt:
bool(false)
string(11) "random text"
random text
Interestingly file_get_contents() is now able to open the files, I must have been doing something wrong previously. But still, is_readable() returns FALSE, but PHP proceeds to be able to read the files anyway. The above test results are from the mapped drive on the NAS, running the same script locally gives:
existing file.txt:
bool(true)
string(36) "some random text I typed in earlier."
some random text I typed in earlier.
new.txt:
bool(true)
string(11) "random text"
random text
here is_readable() returns TRUE.
Again, this behaviour is curious to me, and is a problem because I was hoping to use a framework that calls is_readable() as a part of it's sanity check during opening files, and it means I can't have the convenience of having my dev files hosted on the NAS.
I would be interested in anyone's input, presumably I am missing something trivial, but I am happy to run any tests suggested. For example, I thought it is likely to be a permissions issue, which would make it an issue with the NAS rather than with PHP, but the above script outputs make me wonder.