Jump to content

Read access to a locked filed in c++ (Windows XP)


Recommended Posts

Hi,

I am trying to develop a tool aimed at reading a file which is being written by another process, under Windows XP platform. I remember my computer teachers telling that Windows OS is not flexible to multiple access to files, on contrary to Unix based OS. Unfortunaltely, the writting process cannot be modified (I don't have sources).

Let's say 1.exe is continuously writing data every second in log.txt.

I am trying to write a program 2.exe able to read this log.txt every 5 seconds and raise a warning if a certain condition is fulfilled in log.txt.

Log.txt has no read access permitted while 1.exe is running, which is a big problem.

The only solution I have found is to use the Windows Volume Shadow Service to be able to copy log.txt and read the copy with 2.exe, which is not satisfactory because the copy step becomes longer as the log.txt file gets bigger.

I thought of using a network architecture, ensuring that the file is recorded by a unix based OS. Is it possible to do that on a single laptop not connected to a network?

Another idea is to redirect file to a process input, able to duplicate between a file record and a treatment function for warning report. Any software or example existing?

Thanks for your help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy