create file in user's temp folder
- by user2867494
I am using the following code to try and create a file in the user's temp folder, but it will not.
var fs = require('fs');
var os = require('os');
var ostemp = os.tmpdir();
var exec = require('child_process').exec;
var file = fs.createWriteStream(ostemp + '\setup.exe');
ostemp will return a path similar to 'c:\users\user\appdata\local\temp'
But the code above will save the file to local, and the filename will be tempsetup.exe
Why is that?