Prev: DbDataReader.HasRows - Whose Idea was that?
Next: Where to use static constructor and static class
From: Giulio Petrucci on 27 May 2010 05:38 Hi there, How can I: - lock a file foo.xml to write/append it and avoid other processes to read/write it? - verify if a file is locked and wait for it to be unlocked to read and modify it? Thanks in advance, Giulio --
From: Patrice on 27 May 2010 07:04 Hi, > How can I: > - lock a file foo.xml to write/append it and avoid other processes to > read/write it? > - verify if a file is locked and wait for it to be unlocked to read and > modify it? See : http://msdn.microsoft.com/en-us/library/7db28s3c.aspx and the "share" parameter. You'll have an IOException if you try to open a locked file (you'll have to pause and wait yourself with possibly a retry count or a timeout in case the file remains locked)... -- Patrice
|
Pages: 1 Prev: DbDataReader.HasRows - Whose Idea was that? Next: Where to use static constructor and static class |