Skip to content

Commit

Permalink
Fix temp folder in windows and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonalo committed Feb 11, 2014
1 parent 3a4a475 commit 24adf93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tempdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ var RDWR_EXCL = cnst.O_CREAT | cnst.O_TRUNC | cnst.O_RDWR | cnst.O_EXCL;

var tempDir = function () {
var now = new Date();
var filePath = [os.tmpDir(),
now.getYear(), now.getMonth(), now.getDate(),
var filePath = path.join(os.tmpDir(),
[now.getYear(), now.getMonth(), now.getDate(),
'-',
process.pid,
'-',
(Math.random() * 0x100000000 + 1).toString(36)].join('');
(Math.random() * 0x100000000 + 1).toString(36)].join(''));
if (!fs.existsSync(filePath)) {
fs.mkdirSync(filePath);
}
Expand Down

0 comments on commit 24adf93

Please sign in to comment.