GithubHelp home page GithubHelp logo

bpedro / node-fs Goto Github PK

View Code? Open in Web Editor NEW
68.0 68.0 13.0 201 KB

Extended node fs library, implementing new features like recursive directory creation

License: MIT License

JavaScript 100.00%

node-fs's People

Contributors

aksh3ll avatar andyburke avatar beatgammit avatar bpedro avatar johnfriz avatar pdehaan avatar piatra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-fs's Issues

EISDIR error

I receive an error message which I have no idea how to resolve. I guess it's a bug in this library?

Error:

events.js:48
    throw arguments[1]; // Unhandled 'error' event
                    ^
Error: EISDIR, illegal operation on a directory '/var/storage/1/2011/11/19'

Compressed code:

var fullPath = '/var/storage/1/2011/11/19';
fs.mkdir(fullPath, 0777, true, function(err){ console.log(err); });

Error: EEXIST, file already exists

I'm gettingError: EEXIST, file already exists exceptions on Ubuntu 12.04.1 LTS with node v0.8.14.

I've traced the error back to this code in mkdirSync_p:

if (e.errno != 17) {
  throw e;
}

The problem is that errno is a deprecated internal libuv code, which has changed from 17 to 47. The solution is to replace this with the much more robust:

if (e.code != 'EEXIST') {
  throw e;
}

The same fix will be needed in mkdir_p too, of course.

what happens when a directory already exists?

suppose i do this
fs.mkdirSync('/tmp/example_sync/first/second/third/fourth/fifth', 0777, true);
then this
fs.mkdirSync('/tmp/example_sync/first/second/third/fourth/fifth/sixth/seventh', 0777, true);
and then this
fs.mkdirSync('/tmp/example_sync/first/second/third/', 0777, true);

what will happen? will any exception be thrown that file already exists??

if yes then how can i get it such that the node-fs will ignore and just continue executing and creating the rest of the folders(if passed as arg)..

fs.exist don't work into the while

while(!success){
    fs.exists(path, function (exists) {
        console.log('this will be never called');
        if(!exists)
            success = true
        else{
            i++;
            newPath(req);
        }
    })
}

that code don't work, fs.exists just dont run into the while!

overly specific "os" field

The os field too specific, failures on smartos are caused by this from this as well as other *nix platforms.

2661 error notsup Unsupported
2661 error notsup Not compatible with your operating system or architecture: [email protected]
2661 error notsup Valid OS:    linux,darwin,freebsd
2661 error notsup Valid Arch:  any
2661 error notsup Actual OS:   solaris
2661 error notsup Actual Arch: x64
2662 error System SunOS 5.11
2663 error command "/opt/local/bin/node" "/opt/local/bin/npm" "install"
2664 error cwd /...
2665 error node -v v0.8.8
2666 error npm -v 1.1.59
2667 error code EBADPLATFORM
2668 verbose exit [ 1, true ]

!win32 would generally be better I would think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.