var path;
for (var i = 0, c = paths.length; i < c; i++)
{
    path = paths[i];
    fs.lstat(path, function (error, stat)
    {
        console.log(path); // this outputs always the last element
    });
}
How can I access the path variable, that was passed to fs.lstat function?
 
     
    