Help: How to check for unmount/bad disks before read file

Posted by jameslooi888 on 2016-08-10 02:12

I need help here.
I have list of directory/file path and my program will read through every one.
Somehow one of the directory is unmount and cause my program hang over there when I'm try to open the file using command below.

catch {set directory_fid [open $filePath r]}

So, how can I check the directory status before I'm reading/open the file? I want to skip that file if no response for certain time and continue to read next file.

*[file isdir $dir] is not working as well
*There is no response when i'm using "ls -dir" in Unix also.