469,623 Members | 1,454 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

simultaneous access to flat file

Hello all,
I have to access a flat file (.txt or something) by two applications at the
same time. For reading and writing. Is that possible and how?
Thanks
Frank
Sep 27 '06 #1
2 1991
I thought of something. Is it possible with an XML file?
Frank

"Frank" <fr*******@advitronic.nlwrote in message
news:12*************@corp.supernews.com...
Hello all,
I have to access a flat file (.txt or something) by two applications at
the same time. For reading and writing. Is that possible and how?
Thanks
Frank

Sep 27 '06 #2

A text file should be fine, if both processes open it with shared
write access (or read/write) then they can both write to it (or read).
If it's a simple file like a log file then it should be ok but you
could get occasional hiccups where text from one write is in the
middle of another unless you use some type of cross process
synchronization (i.e., Mutex).

XML is different though.. because XML has to be well formed it would
be very difficult to have to applications both write to the same file
and ensure that the resulting file is still well-formed after every
write. You'd need to synchronize the processes and whenever one wrote
to the file it triggered the other to read the changes and sync it's
internal structure. It'd be far more reliable to have only one of the
processes actually read/write the file and the second process can
communicate back with the first to interact with it (Remoting).

HTH,

Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

On Wed, 27 Sep 2006 20:51:40 +0200, "Frank" <fr*******@advitronic.nl>
wrote:
>I thought of something. Is it possible with an XML file?
Frank

"Frank" <fr*******@advitronic.nlwrote in message
news:12*************@corp.supernews.com...
>Hello all,
I have to access a flat file (.txt or something) by two applications at
the same time. For reading and writing. Is that possible and how?
Thanks
Frank
Sep 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Claudio Grondi | last post: by
7 posts views Thread by Ruben Baumann | last post: by
1 post views Thread by Fordraiders | last post: by
15 posts views Thread by lxyone | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.