Skip to content

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

@yoavain-sundaysky

Description

@yoavain-sundaysky

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions