GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs.writeFile callback has no error when writing file failed · Issue #13868 · nodejs/node

fs.writeFile callback has no error when writing file failed #13868

New issue
Copy link
New issue
Copy link
Closed
Closed
fs.writeFile callback has no error when writing file failed#13868
Copy link
Labels
fsIssues and PRs related to file-system APIs and the fs module.libuvIssues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.wipIssues and PRs that are still a work in progress.

Description

@apoliszk
apoliszk
opened on Jun 22, 2017
Issue body actions
  • Version: v8.1.2
  • Platform: win10 64bit
var fs = require('fs');

fs.writeFile('test: abc.js', 'aaaa', function (err) {
    debugger;
});

The filename has a colon which is not allowed on win10.
The piece of code wrote a file named test which suppose to be test: abc.js, and there was no content.
The execution was failed, but there was no error. Parameter err is null.

Reacted by Refael Ackermann, cheerfunfun and Parvez Kose

Activity

  1. vkurchatkin
    added
    windowsIssues and PRs related to the Windows platform.
    fsIssues and PRs related to file-system APIs and the fs module.
    libuvIssues and PRs related to the libuv dependency or the uv binding.
    on Jun 22, 2017
  2. XadillaX commented on Jun 22, 2017

    @XadillaX
    XadillaX
    on Jun 22, 2017
    Contributor
    More actions

    @apoliszk how about v6 and v4?

  3. XadillaX commented on Jun 22, 2017

    @XadillaX
    XadillaX
    on Jun 22, 2017
    Contributor
    More actions

    It seems CreateFileW (Refer here) don't support :. I'll try to work for it.

    Reacted by kzhang
  4. refack
    added
    wipIssues and PRs that are still a work in progress.
    on Jun 22, 2017
  5. bzoz commented on Jun 27, 2017

    @bzoz
    bzoz
    on Jun 27, 2017
    Contributor
    More actions

    This is a lesser known feature of Windows - alternative data streams. You can read more about them in this MSDN article.

    The data is there:

    D:\>node -e "require('fs').writeFile('testfile:abc', 'some data', console.log)"
    null
    
    D:\>dir /r testfile
     Volume in drive D is Staff
     Volume Serial Number is 565B-E08C
    
     Directory of D:\
    
    27.06.2017  10:49                 0 testfile
                                      9 testfile:abc:$DATA
                   1 File(s)              0 bytes
                   0 Dir(s)  10 776 190 976 bytes free
    
    D:\>more < testfile
    
    D:\>more < testfile:abc
    some data
    
    Reacted by kzhang
  6. bzoz commented on Jun 27, 2017

    @bzoz
    bzoz
    on Jun 27, 2017
    Contributor
    More actions

    Also, note that for other chars Node fails as expected:

    D:\>node -e "require('fs').writeFile('testfile>abc', 'some data', console.log)"
    { Error: ENOENT: no such file or directory, open 'D:\testfile>abc'
      errno: -4058,
      code: 'ENOENT',
      syscall: 'open',
      path: 'D:\\testfile>abc' }
    
  7. apoliszk commented on Jun 28, 2017

    @apoliszk
    apoliszk
    on Jun 28, 2017
    Author
    More actions

    Thanks everyone.
    I got it.
    It is how windows is designed, not a bug.

  8. apoliszk
    closed this as completedon Jun 28, 2017
  9. refack
    added a commit that references this issue on Jul 9, 2017

    doc,test: fs - reserved characters under win32

    a2d3cec
  10. addaleax
    added a commit that references this issue on Jul 11, 2017

    doc,test: fs - reserved characters under win32

    1ebb643
  11. addaleax
    added a commit that references this issue on Jul 18, 2017

    doc,test: fs - reserved characters under win32

    4f0eb6f
  12. Fishrock123
    added a commit that references this issue on Jul 19, 2017

    doc,test: fs - reserved characters under win32

    fa3694f
  13. bhadkiaftab commented on Aug 10, 2017

    @bhadkiaftab
    bhadkiaftab
    on Aug 10, 2017
    More actions

    This error will occure when mentioned directory is not present in that path.

  14. MylesBorins
    added a commit that references this issue on Sep 5, 2017

    doc,test: fs - reserved characters under win32

    c307f03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to file-system APIs and the fs module.libuvIssues and PRs related to the libuv dependency or the uv binding.windowsIssues and PRs related to the Windows platform.wipIssues and PRs that are still a work in progress.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.