lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Petersen" <rober...@buy.com>
Subject code comment {{Aroush}} what is canRead() in C#?
Date Tue, 13 Jun 2006 22:22:39 GMT
{{Aroush}} what is canRead() in C#?

 

I don't believe there is a way to test if you can read from a file.  I
would simply wrap the section doing the reading in a try block and catch
any file IO exceptions.   

 

You can read a file's attributes and see if it is readonly or archive.  

 

// at least on windows, some temporary files raise this exception with
an "access denied" message

 

This usually happens when another process is also accessing the same
file you want to access and has it locked.  Then you can't even open it
for reading.  Occasionally, some of these 'file locks' are orphaned and
then you have to reboot to clear them.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message