Any idea how to read data from a file that is locked by another process?
When I try fopen() or CreateFile() or OpenFile() I get sharing violation.
Yet if I go to command prompt and do a “c:> more blah.h” I can see the file. So “more” somehow can read the file. Any idea how it accomplishes that?
Thanks!
fopen is deprecated and msdn recommends fopen_s but sharing isnt enabled for that .
use _fsopen to open the file and enable a flag to share ( _SH_DENYNO ) to give sharing access.
fsopen