GithubHelp home page GithubHelp logo

Comments (10)

cjihrig avatar cjihrig commented on June 9, 2024

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.

shenanigans avatar shenanigans commented on June 9, 2024

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.

cjihrig avatar cjihrig commented on June 9, 2024

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.

shenanigans avatar shenanigans commented on June 9, 2024

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.

piscisaureus avatar piscisaureus commented on June 9, 2024

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.

orangemocha avatar orangemocha commented on June 9, 2024

Will test this on Win10

from node-convergence-archive.

silverwind avatar silverwind commented on June 9, 2024

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.

ChALkeR avatar ChALkeR commented on June 9, 2024

@shenanigans A few questions here:

  1. Doesn't rm \\?\D:\whatever. (or rmdir \\?\D:\whatever., if it's a directory) work? If it doesn't, what error does it produce?
  2. Is it possible to create a file/directory using Node fs module that you couldn't later delete using Node fs module? If yes, could you share a testcase?
  3. What exactly are the differences in Windows 10 compared to previous versions? What «old methods» are you referring to?
  4. 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.

shenanigans avatar shenanigans commented on June 9, 2024

@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.

rvagg avatar rvagg commented on June 9, 2024

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)

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.