title: need a read function with timeout to copy file from damaged disk
body: <p>I want to copy a file from CD to my computer but the CD is damaged in certain parts, so about 4-6% of the file is damaged, can not be read. I have tried a lot of file copier programs out there, none helped. When they reach damaged bytes, they take forever to copy. So, I decided to make a file copier suitable for this. For this I need little help:</p>
  
  <p>How to make program read bytes from a file with a timeout? When it takes longer than certain amount time to read a byte it should return null or error of some kind. Any of these platforms will do: Windows, Linux, DOS.</p>
  
  <p>For example, in Linux gcc, in c programming, how to read specific byte from a file with a timeout?</p>
  
  <p>Note: I want to make a program that copies file from damaged CD, and skips unreadable bytes. As, long as it recovers whatever is readable from, I am ok.</p>