F
F
Flummox_lnc2022-02-09 14:50:18
JavaScript
Flummox_lnc, 2022-02-09 14:50:18

Why doesn't chokidar.watch capture a file change?

My task is quite simple (as it seemed to me), I needed to find out when minecraft overwrites the latest.log file in the logs folder and then operate with the changes.
I looked at how changes can be fixed and wrote (copy-pasted) the code according to the template:

const chokidar = require('chokidar');
  chokidar.watch('путь к файлу').on('all', (event, path) => {
    console.log(event, path); 
  });

However, this solution only notices changes if I personally open the file and change something in it, and when the game makes entries in it, this process goes unnoticed, please tell me why and how can I fix it?
I also tried to follow through fs.watch but the same problem arose there.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question