Skip to content

File created using tmp.fileSync() cannot be deleted on Windows #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
yoavain-sundaysky opened this issue Nov 21, 2019 · 2 comments
Closed
2 tasks done

Comments

@yoavain-sundaysky
Copy link

Operating System

  • Windows 10

NodeJS Version

  • 12.x

Tmp Version

0.1.0

Expected Behavior

the following code should delete temp file:

import * as tmp from "tmp";

let tempFile = tmp.fileSync();
fs.unlinkSync(filename);

Experienced Behavior

File stays even after node exits.

Note:

  1. When creating file using fs.writeFileSync(), i'm able to delete it.
  2. Tried with fs-extra remove() and the result is the same
  3. When creating temp directory using tmp.dirSync() it is possible to delete it using fs-extra remove()
@silkentrance
Copy link
Collaborator

This might be related to #198 and #199.

@silkentrance
Copy link
Collaborator

Fixed with #198.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants