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.

Dir is not cleaned when I hit ctrl+c

See original GitHub issue

I’m using tmp package in unit tests with tmp.setGracefulCleanup();. I’m creating temp directory for tests with unsafeCleanup = true.

It works fine if I don’t hit ctrl+c to interrupt tests. Then the temp dir is not deleted. How can I get it deleted automatically in this case?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28

github_iconTop GitHub Comments

2reactions
silkentrancecommented, Jun 30, 2017

@JanBednarik thank your very much. I think that I have found the problem. There exists a SIGINT event and tmp should be listening on that, too. The only problem is that under Windows one must take a different approach. I will look into this.

1reaction
octagonalcommented, Sep 7, 2018

@silkentrance Would it be possible to make some time to merge this? It would be very helpful for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cleanup tmp dirs when hitting CTRL-C from perl -d debug ...
When the program terminates, any objects that are still in scope are cleaned up by calling their DESTROY methods. File::Temp->newdir returns a ...
Read more >
Can I run a command after the user uses Ctrl-C to kill a ...
I'ma head off the obvious answers to this: use a script. I really want to keep using the same command as the rest...
Read more >
linux - What happens if mv is interrupted? - Super User
@Wesley: No, there will be no partial file. If the system stays up (e.g., you hit ctrl-C), it will be removed automatically. If...
Read more >
Windows Admin Center known issues | Microsoft Learn
Ctrl -C to copy doesn't work, it will always send the Ctrl-C break command to the console. Copy from the right-click context menu...
Read more >
How is the /tmp directory cleaned up? - Ask Ubuntu
The default value of $TMPTIME is 0, which means every file and directory in /tmp gets deleted. $TMPTIME is an environment variable defined...
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