bpedro / node-fs Goto Github PK
View Code? Open in Web Editor NEWExtended node fs library, implementing new features like recursive directory creation
License: MIT License
Extended node fs library, implementing new features like recursive directory creation
License: MIT License
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); });
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.
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)..
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!
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.