question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does tmp remove quotes from paths ?

See original GitHub issue

Operating System

  • Linux
  • Windows 7
  • Windows 10
  • MacOS
  • other:

NodeJS Version

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

Tmp Version

0.2.1

Expected Behavior

Don’t remove quotes from paths

Experienced Behavior

Quotes are being removed

See https://github.com/raszi/node-tmp/blob/master/lib/tmp.js#L564-L575

For example on Windows the tmpdir is in general in C:\Users\username\AppData\Local\Temp. A username may contain a quote and / or a double quote (Bob's Computer for example).

_getTmpName calls _sanitizeName on os.tmpdir() and returns a folder that does not exist.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
zvincommented, Aug 4, 2021

Alright, keep your bugs then.

users can have arbitrary names, yet, these will be slugged into a filesystem compatible name

This is not true, you can create users with ampersands and quotes in the username on Windows 10, these characters will remain in the folder name on the filesystem.

we did not have any complaints since the changes were in effect.

There was at least me, the author of #246 and a thumbs up above.

stand by the decision that quotes (and other stuff) must be eliminated from tmp generated names or directories.

And thus pointing to files or directories that do not exist.

3reactions
katrinaluicommented, Feb 24, 2022

Just want to chime in with my “complaint.” This is causing issues for us as some Windows users have apostrophes in their profile name, leading to temp file paths with nonexistent directories when using this library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolved - No Such File or Directory. No .tmp files - Unity Forum
), this issue is caused by the presence of a single-quote character (') or double-quote character (") in the paths used by the...
Read more >
bash - Remove line in a file in similar found in a list - Stack Overflow
Hello, first cat did nothing, the second almost worked, it only deleted the last line with the .tmp, and if I add the...
Read more >
linux - Are we supposed to manually delete the contents of /tmp?
To answer the questions: Is /tmp supposed to be emptied automatically: Yes; Are we supposed to delete Files in /tmp regularly and manually: ......
Read more >
Advanced Quoting in Shell Scripts - Scripting OS X
But when you put the ~ in the quotes, it will not be substituted to the user's home directory path. There are a...
Read more >
DeleteFiles@1 - Delete files v1 task - Microsoft Learn
The file/folder paths to delete. Supports multiple lines of minimatch patterns; each one is processed before moving onto the next line.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found