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.

Suggestion: about temporary file

See original GitHub issue

Currently, after running selected code in Code Runner, it leaves a temporary file with the name set in code-runner.temporaryFileName in working dir. If we don’t need that any more, we have to remove it manually. What about adding a setting about whether the temporary file would be removed automatically after running?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
mil1icommented, Mar 22, 2019

It is not deleting the temp files for me whether it is run in Output or Terminal. They always persist. Doesn’t matter which language either.

In order for them to delete, I must use the mappings like above with a ‘rm tempCodeRunnerFile.<ext>’ command at the end.

4reactions
filipesilvacommented, Feb 23, 2019

For those interested, this is how my executorMap looks like for the languages I use:

  "code-runner.executorMap": {
    "javascript": "node $fullFileName && rm -f $dirWithoutTrailingSlash\\\\tempCodeRunnerFile.js",
    "typescript": "ts-node $fullFileName && rm -f $dirWithoutTrailingSlash\\\\tempCodeRunnerFile.cljs",
    "clojure": "lumo $fullFileName && rm -f $dirWithoutTrailingSlash\\\\tempCodeRunnerFile.cljs",
  },

Notes:

  • I am on Windows, using GitBash, and running on terminal.
  • the -f flag is needed to prevent rm: cannot remove 'path/here': No such file or directory when running the real file (without a selection).
  • using $dirWithoutTrailingSlash is needed because the path is surrounded by quotes and the final slash on windows will escape the quote.
  • double escaped slashes (\\\\) are needed otherwise it will end up as \tempCodeRunnerFile, and \t means escape t.
  • will not delete the file if code execution fails.

It works but there are a few things to keep in mind when doing it manually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Security Tips for Temporary File Usage in Applications
Security Considerations when designing Temporary File modules · 1. Avoid temporary files altogether · 2. Reasearch the platform support for ...
Read more >
Windows Temporary File Error - Microsoft Community
Clean the temp on your machine: On the Desktop, simultaneously press the Windows + R hotkey to open or Run. Now type TEMP...
Read more >
How to View and Remove Temporary Program Files
Viewing and deleting temporary files. To view and delete temp files, open the Start menu and type %temp% in the Search field. In...
Read more >
[Feature suggestion] Path of temporary files - KNIME Forum
To me, it seems to be a much more flexible solution to store temporary files within dedicated KNIME folders (e. g. /tmp/KNIME) instead...
Read more >
Temporary files not deleting in Windows 11/10
There are different ways to delete Temporary Files on Windows. One quick way to resolve this is by going to Settings (Win +...
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