Cannot read a file that is used by another process

I am trying to read a file with the Overwolf API (, but the file I am trying to read is always opened by another process. I know that you can open such files because with the normal Node fs module you can open it regularly, but the Overwolf API doesn’t let you.

Here is the code snippet in question:

const data: string = await new Promise((resolve, reject) => {
        ({ error, content }) => {
            if (error) reject(error);

This does in fact seem like a weird interaction. I’ll check this internally and see if it’s a known phenomena or not, and also what you should do about it.

While we’re looking into it, we have a few questions:
What’s the name (or rough purpose) of the file in question?
Why is it constantly open (is it something like a log file that’s constantly being written to)?

The file is the lockfile of the game that stores the keys to use the internal api of the game. I contacted support of the game and i got permission to use the api, if it not alters the gameplay of the person using the program (for example ESP is bannable because is gives an unfair advantage, but something like a stats tracker which I am trying to make is allowed)

So, for debugging purposes, could you please try the following methods, to see if any of them works?
file stream
read by type (text/binary)
copy to then read from the copy and didn’t work, but and did work. Thank you very much for the help.

Glad to hear that worked!
This still does sound like an issue though, so it would help us if you could share some details so we can try to figure out what went wrong (depending on what you want to/can share):
Does this still happen even when the game is closed?
Can you provide the original file/a file where the issue also occurs?
What game is it happening in?

The file in question is the lockfile of Valorant. The Game always reads and writes the file to use internal APIs. If I close the game, the file does not exist. It seems like can read files that are being read by other processes, but cannot. Unfortunately, I cannot provide the file because it may contain keys that could be used maliciously by others.

So, in general, readTextFile and readBinaryFile are more stable (and also faster!), so it’s not too bad, but we’ll look into it to find out the exact circumstances (and at least add a warning if it isn’t a bug)

Thank you once again for the details, and let us know if you encounter anything else!