Hi
I have a text file that I use to hold some information. At one point, this text file needs to be edited. So far so good. The problem is that the file may be located on a media that does not allow write access (floppy with write protect, CD, or no write access on file for user).
I've tried opening the file with the streamreader and checked the basestream.canwrite but it always return false. And if i directly use streamwriter, when the file cannot be written to, I get the FileIOException raised (absolutely normal).
Does anyone have an idea of how to check if a file can be written to?
Thanks
Jeff
I have a text file that I use to hold some information. At one point, this text file needs to be edited. So far so good. The problem is that the file may be located on a media that does not allow write access (floppy with write protect, CD, or no write access on file for user).
I've tried opening the file with the streamreader and checked the basestream.canwrite but it always return false. And if i directly use streamwriter, when the file cannot be written to, I get the FileIOException raised (absolutely normal).
Does anyone have an idea of how to check if a file can be written to?
Thanks
Jeff