Comments (10)
I don't think we should do this in core. While Node can create a file that you can't remove using Explorer, you're able to remove the same file programmatically. This seems like something that would make a nice userland module though.
from node-convergence-archive.
This might be a new win10 issue, and I'm (rather hopelessly) attempting to raise the issue with Microsoft, but I haven't had tons of luck removing them programmatically either. edit but good point, I'll go check if graceful-fs is doing this yet
from node-convergence-archive.
I tested on Windows 7, using fs.unlinkSync()
. I'm not sure if it works on Windows 10. Calling for backup...
cc @piscisaureus and @orangemocha
from node-convergence-archive.
That's...... odd. I fought with this quite a lot yesterday. When I shut the system down last night my stubborn directory still stood. Looking at it again now, about 24 hours later, it's disappeared all the way back to a distant parent directory. Making a new badly-named file I can't reproduce the bug at all. My face right now dot jpeg.
I'm starting to think this might have just been a Win10 bug all along. Wouldn't be the first filesystem-related screwup.
from node-convergence-archive.
Node bypasses some of the sanity checks/rules that windows normally enforces - primarily in order to support filenames longer than 260 characters. And I'm aware that this creates trouble sometimes. However you should never get completely stuck -- you should be able to delete any file created by node ... with node :).
I'm adamant to doing more path sanitization on windows - we could remove trailing dots and whitespace, for starters, as I'm sure windows normally does that. I don't know exactly what other transformations it does.
Starting point for making these changes would be path._makeLong()
.
from node-convergence-archive.
Will test this on Win10
from node-convergence-archive.
I'm not sure if this information is still up to date, but there's a historical list of system-reserved file/folder-names that can't be modified through Explorer:
http://blog.onetechnical.com/2006/11/16/forbidden-file-and-folder-names-on-windows/
from node-convergence-archive.
@shenanigans A few questions here:
- Doesn't
rm \\?\D:\whatever.
(orrmdir \\?\D:\whatever.
, if it's a directory) work? If it doesn't, what error does it produce? - Is it possible to create a file/directory using Node
fs
module that you couldn't later delete using Nodefs
module? If yes, could you share a testcase? - What exactly are the differences in Windows 10 compared to previous versions? What «old methods» are you referring to?
- What would be the expected behaviour in your opinion?
Edit: AFAIK, the answer to question (1) is «yes, it works», and to question (2) — «no, it's not». If so, the problem is quite minor, but if you prove me wrong — it would make it a bit more serious.
from node-convergence-archive.
@ChALkeR Windows native del
is handling this ok, today. The "old method" I mean is the incantation rd \s "\\?\c:\etc"
. I basically can't reproduce the issue right now (and feel properly silly about it) but whenever one of these commands fails it acts like the file or directory cannot be found.
In answer to number three, at least as an example, what's new about Windows 10 on my system is that every time windows update queues a reboot it logs a bad hard drive sector and crashes. I'm less than comfortable with the integrity of its filesystem at this point.
As for expected behavior, the existing behavior for improper filenames seems acceptable to me.
> fs.writeFileSync ('*()_*$*', 'cheddar cheese')
Error: ENOENT, no such file or directory 'c:\data\*()_*$*'
The file descriptor fails to open and cannot be written. That fault may be easy to produce artificially for filenames that just should not be written. And I've heard a rumor that writing sketchy filenames can get antivirus software angry about your script...
from node-convergence-archive.
be aware that this discussion may be lost to history as this repo is slated for possible removal, if this is important please discuss @ https://github.com/nodejs/io.js
from node-convergence-archive.
Related Issues (20)
- Node Foundation TSC Meeting 2015-06-24 HOT 5
- Optionally log master secrets for TLS connections HOT 1
- Node Foundation TSC Meeting 2015-07-01 HOT 8
- Consider/Evaluate Amazon's "s2n" TLS library HOT 6
- Cannot call method then of undefined HOT 2
- node: ../deps/uv/src/uv-common.c:143: uv_err_name: Assertion `0' failed. HOT 10
- Node Foundation TSC Meeting 2015-07-08 HOT 2
- uv_err_name: Assertion `0' failed during npm install HOT 3
- First release as the Node Foundation? HOT 1
- Node Foundation TSC Meeting 2015-07-15 HOT 16
- Node Foundation TSC Meetings are not being uploaded to Youtube HOT 6
- Node Foundation TSC Meeting 2015-07-22 HOT 7
- Node, OpenSSL, and patented encryption algorithms HOT 10
- Node Foundation TSC Meeting 2015-07-29 HOT 9
- net::Server.unref() failed on cluster mode HOT 3
- Provide a fs.createDirectoryReadStream (or something similar) to return a stream of files and directories within a directory HOT 1
- make install doesn't expand ~ on Linux HOT 2
- npm does nothing HOT 1
- [Converge] MSI related changes HOT 1
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 node-convergence-archive.