I am trying to use webparser to parse a local file however since it is a log file and being constantly written to, I am given an error. The error I'm getting is.
[MeasureParent]: (Fetch error) The process cannot access the file because it is being used by another process. (ErrorCode=32)
How might I go around this issue? I'll leave my skin. I know it is not an issue with my regex because I tested it with RainRegExp and it worked just fine.
Kosidive wrote: ↑August 4th, 2021, 2:58 am
I am trying to use webparser to parse a local file however since it is a log file and being constantly written to, I am given an error. The error I'm getting is.
[MeasureParent]: (Fetch error) The process cannot access the file because it is being used by another process. (ErrorCode=32)
How might I go around this issue? I'll leave my skin. I know it is not an issue with my regex because I tested it with RainRegExp and it worked just fine.
The process that is creating the log is opening it in "exclusive" write mode, so you just won't be able to access it.
Assuming you can't control the code that is creating the log file, the only thing that comes to mind is to have Rainmeter "kill" the process that is creating the log, make a copy of it or read it directly, then restart the process. This is going to make reading the log file in any kind of "real time" way impossible of course.
If not for the "exclusive mode" jsmorley mentioned, quite easily:
- use either Debug=2, Debug2File, Download or DownloadFile in the WebParser parent, to save the file
- use a 2nd WebParser parent to read the saved file, by opening it locally, through URL=file://SomePath\SomeFile.txt
Yincognito wrote: ↑August 5th, 2021, 5:07 pm
If not for the "exclusive mode" jsmorley mentioned, quite easily:
- use either Debug=2, Debug2File, Download or DownloadFile in the WebParser parent, to save the file
- use a 2nd WebParser parent to read the saved file, by opening it locally, through URL=file://SomePath\SomeFile.txt
Right, but I doubt that a file that is locked from reading is going to allow WebParser to make a copy of it.
jsmorley wrote: ↑August 5th, 2021, 5:08 pm
Right, but I doubt that a file that is locked from reading is going to allow WebParser to make a copy of it.
r - open a file in read mode.
w - opens or create a text file in write mode.
a - opens a file in append mode.
r+ - opens a file in both read and write mode.
a+ - opens a file in both read and write mode.
w+ - opens a file in both read and write mode.
r - open a file in read mode.
w - opens or create a text file in write mode.
a - opens a file in append mode.
r+ - opens a file in both read and write mode.
a+ - opens a file in both read and write mode.
w+ - opens a file in both read and write mode.
No doubt this log is opened in w or a mode.
As far as I know, it's a bit of a bad practice to do such things in an exclusive mode, but then, that software probably has its reasons to do so...