atom / node-pathwatcher

Path Watcher Node Module
http://atom.github.io/node-pathwatcher
MIT License
93 stars 47 forks source link

onDidChangePath not called for fs.renameSync on Linux #92

Open winstliu opened 9 years ago

winstliu commented 9 years ago

Simple repro steps:

# init.coffee
atom.workspace.observeActivePaneItems (item) ->
  item.onDidChangePath ->
    console.log 'PATH CHANGED'
// Dev tools
var fs = require('fs-plus');
var bufferToChange = atom.workspace.getActivePaneItem();
var filePath = bufferToChange.getPath();
var newPath = filePath + "2";
fs.moveSync(filePath, newPath);  //or .removeSync()

Observe that 'PATH CHANGED' does not appear in the console. If you change moveSync to .saveAs(), 'PATH CHANGED' will appear.

To verify that a fix works just make sure this text-buffer spec passes on Linux.

Refs atom/atom#7315.