I am deleting file when I receive event stopRecording from client that is working as expected -- file is deleted from directory.
My question here is when I look into directory using Windows (WebStorm IDE) file name is still visible there but when I click on file name it got removed from directory.
I am not sure what I should do here because functionality is working it's just matter of filename visibility until you click its there.
What will be behavior on server and how can I resolve this problem ?
logRecording.js
deleteFile:function (filename) {
var path = './app/records/templogs';
var file = path + '/'+ filename;
console.log('filename in delete', filename);
fs.unlink(file);
}
socketIo.js
socket.on('stopRecording',function (filename) {
console.log('stop recording data',filename);
logsRecording.deleteFile(filename);
});