Get previous filename with NodeJS rename action


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

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


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


There is currently no discussion for this recipe.

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