I am trying to check if a file has been locked with another application.
I figured than I can do that easily by opening the file in writing mode.
fs.open('myfile.docx', 'r+', (err) => {
if (!err) {
console.log('File unlocked')
}
})
However, I do not want to lock the file because the other app could write data at any moment.
So, is there any way to check if a file is locked without locking it (and without administrative rights by using either node.js or windows cmd) ?