Skip to content

tmpNameSync: Bad result if the TMP/TEMP env. variables are enclosed in quotes #246

Description

@haneefdm

Operating System

  • Linux
  • Windows 7
  • [ x] Windows 10
  • MacOS
  • other:

NodeJS Version

  • 0.x
  • 4.x
  • 6.x
  • 7.x
  • other: 10.16.2

Tmp Version

TBD:0.1.0

Expected Behavior

TBD: What have you expected tmp to do?

Create proper tmp-name without quotes

Experienced Behavior

TBD: What did actually happen?

Created path names with embedded quotes if the env. vars TMP and TEMP has spaces in it. I have a space in my user name and we have to use our own TMP directories rather than using the system ones. To reproduce the problem in a shell/cmd set the TMP/TEMP variables to any path with spaces in it

set TMP="C:\users\xxx\T M P"
set TEMP="C:\users\xxx\T M P"
node test.js

The above commands creates the following output. Yes, I can filter the path-name but it was unexpected

Created temporary filename:  "C:\Users\hdm\T M P"\tmp-4832vNUYEwQFRehF

And my test.js looks like

var tmp = require('tmp');
var options = {};
var tmpname = tmp.tmpNameSync(options);
console.log('Created temporary filename: ', tmpname);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions