Skip to content

no such file or directory #204

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
7 tasks
Legends opened this issue Jan 6, 2020 · 3 comments
Closed
7 tasks

no such file or directory #204

Legends opened this issue Jan 6, 2020 · 3 comments
Assignees
Labels

Comments

@Legends
Copy link

Legends commented Jan 6, 2020

Operating System

  • Linux
  • Windows 7
  • [x ] Windows 10
  • MacOS
  • other:

NodeJS Version

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

Tmp Version

TBD:0.1.0

Expected Behavior

TBD:What have you expected tmp to do?
Create a file

Experienced Behavior

TBD:What did actually happen?

ENOENT: no such file or directory, open 'PARTIALS-INJECTOR\1layout.ejs'
at Object.openSync (fs.js:440:3)

Example:

let i = 1;
    var fileOptions = {
        name: `${i}layout.ejs`,
        dir: "PARTIALS-INJECTOR"
    };

    // var dirObj = tmp.dirSync(dirOptions);
    var fileObj = tmp.fileSync(fileOptions);

The folder exists in the Temp folder.

@silkentrance
Copy link
Collaborator

Please have a look at the code here

https://github.com/raszi/node-tmp/blob/master/lib/tmp.js#L131

The dir option overrides the standard tmp directory and is considered relative to the current working directory or an absolute directory, if you pass in an absolute path starting with /.

If you need it to reside under the standard tmp directory, pass in

    var fileOptions = {
        ...
        dir: `${tmp.tmpdir}/PARTIALS-INJECTOR`
    };

@silkentrance silkentrance self-assigned this Jan 15, 2020
@Legends
Copy link
Author

Legends commented Jan 15, 2020

Thanks!

@Legends Legends closed this as completed Jan 15, 2020
@silkentrance
Copy link
Collaborator

related to #205 and #207 and #206

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

No branches or pull requests

2 participants