If you open the file as read only, the best thing is read it in one
gulp with ReadAll you will get whatever it is at that instant. You
will get whatever the file's state is at the time you readall.

If you open it with Read/Write it won't let you which is your first
clue when you catch that error someone else has it. You colud sleep
and Loop keep trying to open it for writing that would be the easiest
way to be the first to grab it after writing is done.

Or even better when you fail to open it for writing, then set a file
watcher on it and when the filewatcher notices the file is rewritten
open ti quickly then.

On 11/26/05, Helge Thomas Hellerud <[EMAIL PROTECTED]> wrote:
>  Hello.
>
>  I have two applications:
>
>  1: Opens and writes content to an existing text file.
>  2: Opens and reads the content of the file, written by application 1.
>
>  If application 2 tries to read the file when it is opened for writing by
>  application 1 - what will happen in application 2? Will an exception be
>  thrown, or will application 2 wait until application 1 has completed
> writing
>  to the file?
>
>  Thanks in advance.
>
>  Helge
>
>
>
>
>
>  ________________________________
>  YAHOO! GROUPS LINKS
>
>
>  Visit your group "AspNetAnyQuestionIsOk" on the web.
>
>  To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>  ________________________________
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to