Get previous filename with NodeJS fs.watch rename action

Problem

Is it possible to get the previous name of a renamed file, using fs.watch in NodeJS? For example:

var fs = require("fs");
fs.watch("some_file",function(action,filename){
    if (action == "rename" && filename)
        console.log("what was the old filename, before the rename action?");
});
Problem courtesy of: Azmisov

Solution

Only on Windows and Linux. On OS X the kernel doesn't support the necessary functionality to send back the filename to your callback.

Oh, I misunderstood the question. You don't want to see the new name. You want to get the old name.

The API doesn't support that at the moment that I know of.

Solution courtesy of: Nathan

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.