Thanks to visit codestin.com
Credit goes to github.com

Skip to content

removeCallback() is not actually synchronous #197

@dieseldjango

Description

@dieseldjango

Operating System

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

NodeJS Version

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

Tmp Version

0.1.0

Expected Behavior

const tmp = require('tmp');
const fs = require('fs');

const tmpobj = tmp.fileSync();
console.log(`Created ${tmpobj.name}`);
tmpobj.removeCallback();
console.log(`Still exists: ${fs.existsSync(tmpobj.name)}`);
setImmediate(() => { console.log(`Still exists after setImmediate: ${fs.existsSync(tmpobj.name)}`); });

removeCallback() is described as synchronous. Running the code above, I would expect both console.log statements checking for the removed file to return false.

Experienced Behavior

removeCallback() isn't really synchronous, it is just an asynchronous operation that doesn't provide a promise or callback. Is this the intended behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions