Thanks for your assistance.
No this is the process.
- I grab data and write it to a file.
- That file is then included in an intranet page. A user opens (i.e. reads)
that page and leaves it open in their browser. This "locks" the file (I
think).
- I then grab data again programatically (scheduled task) and I try to
programmatically overwrite the file that is already open by the intranet
user. An error occurs.
I am trying to eliminate the error but first programmatically checking to
determine if the file is "open" or it is not open and I can safely write to
it.
I do not see anywhere for that check. I know I can trap the error but I
would rather not do that.
"Eliyahu Goldin" wrote:
More likely the problem is in the asp.net process not having enough rights
to access the path.
If the problem is in another user trying to access the file, you can just
try opening the file in a loop for a few seconds with catching exceptions.
But it is not a good idea to make a web application wait for this sort of
things. What is the file for anyway?
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Paul" <Pa**@discussions.microsoft.comwrote in message
news:41**********************************@microsof t.com...
I am getting an "Access to the path "xxxx" is denied error.
I believe is because the file that I am writing to programatically is
being
read/written to by another end user. These files have the same file name
and
must have the same file name. I am essentially overwrite an existing file
that is being used by another user.
My question: Is there some method or property in the IO class that will
allow me to CHECK to see if it is safe to try and write to that file name?
TIA.