Possible Duplicate:
How to check if a PHP stream resource is readable or writable?
Does PHP provide any function to check the access mode of file handle? Suppose I opened a file in read only mode.
$file_handle = fopen('putty.log','r');
Can I check a particular handle's access mode in code?