HI,

I am working with files stream. In my project I need to create a doc file
and save the information added by user in it. I need to Keep This file open
till user is done. But If at the same time a nother user want to open that
file they should be able to view it.

I am using Open command of file streams With File mode Create for writeable
file and File mode open for viewing file.


Here's what I am doing

myStream = New IO.FileStream(path, FileMode.Create, Fileaccess.write,
Fileshare.Read)

writer = new IO.StreamWriter(myStream)

writer.WriteLine("Hello world")

mystream2 = New IO.FileStream(path, FileMode.open, Fileaccess.Read,
Fileshare.Read)

reader = new IO.StreamReader(myStream2)

reader.read().

This is giving me IO.IOException ( another process is alreay using this resource).



Can any one help me here. DOes any one has better idea of accomplishing
this task.

How can I have a file open in the write mode can make other users to
read it.