Comments (8)
@erikkemperman this probably got buried in other emails. Do you have any thought on what the behavior should be for mkdirp'ing on a dangling symlink?
from fs-mkdirp-stream.
@phated Sorry for late reply, pretty swamped just now... If the problem here is that weβre trying to create a directory under an ancestor which is a dangling link, Iβd say throwing an error would be the correct thing to do.
Probably something went wrong earlier, and quietly replacing the dead link with a regular directory just makes that harder to track down.
Does that help?
from fs-mkdirp-stream.
The issue is that fs.stat
fails with ENOENT when called on a dangling link - which we propagate. I think that's incorrect because something does exist on the filesystem, but it's that dangling link. I was also thinking we could maybe create a directory that the dangling link is pointing at. Not sure.
from fs-mkdirp-stream.
@erikkemperman So mkdir -p dangling-link/foo/bar
errors with mkdir: dangling-link/foo/bar: Not a directory
but mkdir -p symlink/foo/bar
does the mkdirp at the target of the link. Maybe we should lstat
/readlink
and then mkdirp at the target?
from fs-mkdirp-stream.
Otherwise we could continue to error but do it with a better message? I want to determine the most intuitive behavior for this and don't necessarily want to mirror mkdir -p
.
Also, this issue was brought to my attention because some user was trying to mkdirp at a dangling link.
from fs-mkdirp-stream.
IMHO the behaviour of mkdir -p makes a lot of sense, actually, the "danger" being that we'd be obfuscating an earlier problem otherwise. And actually the error message I am now seeing on your dangling-link
branch is decent enough, it seems to me, in that it mentions the missing target at least. A trace would be nice, but that's part of a larger issue if I've been tracking things properly?
from fs-mkdirp-stream.
I guess it just feels wrong... I'm going to think on this some more.
from fs-mkdirp-stream.
Comments that I forgot to tie this to:
gulpjs/gulp#2086 (comment)
gulpjs/gulp#2086 (comment)
from fs-mkdirp-stream.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs-mkdirp-stream.