Is it possible to read-lock a file?

后端 未结 1 1143
迷失自我
迷失自我 2020-12-21 05:33

I\'m developing an application which checks for changes made to a file by a separate program (not written by me).

If a change is detected, it opens the file, reads t

相关标签:
1条回答
  • 2020-12-21 06:14

    Yes, you can open a file in a so called Exclusive-Mode. This means nobody than yourself can read or write to that file.

    If you take a look into the File.Open() function. There exists a parameter FileShare which can be set to None.

    0 讨论(0)
提交回复
热议问题