I would like to delete the files that have appeared in the directory as a side effect of running this piece of code. I have tried the following method but it does not work as when I check if any files with the .csv extension are there they are still present. I have used the following link as a template
http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
My code is:
process.on('exit', function()
{
var child = exec('~/.ssh/project' + 'rm *.csv',
function (error, stdout, stderr)
{
if (error !== null || stderr.length > 0)
{
console.log(stderr);
console.log('exec error: ' + error);
proces.exit();
}
});
});
But this is not working since there are still csv files in this directory