Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Error in fs.mkdir #5722

Closed
co2-git opened this issue Jun 20, 2013 · 3 comments
Closed

Error in fs.mkdir #5722

co2-git opened this issue Jun 20, 2013 · 3 comments

Comments

@co2-git
Copy link

co2-git commented Jun 20, 2013

Tested the following code with version 0.8.5. 0.10.7, 0.10.11, 0.10.12 (node installed with nvm on Ubuntu 13.10):

require('fs').mkdir(this.path, function (err) {
  console.log(err);
});

Got:

fs.js:635
  binding.mkdir(pathModule._makeLong(path),
          ^
TypeError: Bad argument
    at Object.fs.mkdir (fs.js:635:11)
    at Object.exports.createBlogDirectory (/home/francois/dev.lin/apps/wordpress/dist/master/wordpress.js:87:17)
    at Object.exports.createBlog (/home/francois/dev.lin/apps/wordpress/dist/master/wordpress.js:81:8)
    at Object.<anonymous> (/home/francois/dev.lin/apps/wordpress/dist/master/wordpress.js:65:10)
    at ReadStream.<anonymous> (/home/francois/dev.lin/apps/wordpress/dist/master/wordpress.js:74:5)
    at ReadStream.g (events.js:175:14)
    at ReadStream.EventEmitter.emit (events.js:95:17)
    at ReadStream.<anonymous> (_stream_readable.js:736:14)
    at ReadStream.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)

Additional tests:

require('fs').mkdir(this.path, 777, function)
require('fs').mkdir(this.path, process.umask(), function)

With same results. Saw you already have issue #1999 but it did not help me

@bodokaiser
Copy link

@co2-git I think there is just an error in your this.path variable

@bnoordhuis
Copy link
Member

What @bodokaiser said. There is nothing here that suggests a bug in node.js itself. It doesn't help that the test case is incomplete. Closing.

@co2-git
Copy link
Author

co2-git commented Jun 20, 2013

Confirmed by OP: error from OP - issue closed. I had a process.exit() somewhere that killed the callback. Plus sorry for the typo in my code example

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

No branches or pull requests

3 participants