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.statSync does not throw an error when accessing non-existent directory on Windows 10 · Issue #9106 · nodejs/node

fs.statSync does not throw an error when accessing non-existent directory on Windows 10 #9106

New issue
Copy link
New issue
Copy link
Closed
Closed
fs.statSync does not throw an error when accessing non-existent directory on Windows 10#9106
Copy link
Labels
fsIssues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.

Description

@balos1
balos1
opened on Oct 15, 2016
Issue body actions
  • Version: v6.7.0
  • Platform: Windows 10 (64 bit)
  • Subsystem: fs

On Windows 10, I am not getting the same behavior of fs.statSync when trying to access a non-existent directory as I do on Linux. The expected result is for an error to be thrown, which occurs on Linux, but not on Windows 10.

Example:

try {
    var stat = fs.statSync(path_to_missing_dir);
    if (stat.isDirectory()) return true;
} catch (err) { 
    console.log(err.message);  // not reached on windows 10
}

Activity

  1. mscdex
    added
    fsIssues and PRs related to file-system APIs and the fs module.
    windowsIssues and PRs related to the Windows platform.
    on Oct 15, 2016
  2. seishun commented on Oct 15, 2016

    @seishun
    seishun
    on Oct 15, 2016
    Contributor
    More actions

    Can't reproduce. Can you provide an example of path_to_missing_dir?

  3. balos1 commented on Oct 15, 2016

    @balos1
    balos1
    on Oct 15, 2016
    Author
    More actions

    The path which I was trying to reach when I came across this problem was C:\\Users\\SomeUser\\Projects\\test\\test_sub\\.git\\.

  4. seishun commented on Oct 15, 2016

    @seishun
    seishun
    on Oct 15, 2016
    Contributor
    More actions

    Are you sure that directory actually doesn't exist and isn't just hidden?

  5. balos1 commented on Oct 15, 2016

    @balos1
    balos1
    on Oct 15, 2016
    Author
    More actions

    Positive it doesn't exist, but I did just try this on another system and can't reproduce... so since I am using nvm-windows to install node, I just upgraded my system to v6.8.0, and the error was properly thrown.

  6. balos1 commented on Oct 15, 2016

    @balos1
    balos1
    on Oct 15, 2016
    Author
    More actions

    OK, reinstalled 6.7.0 on my system and the error is properly thrown now as well. Possibly something was corrupted with my original installation of 6.7.0. Looks like this was a non-issue and can be closed.

  7. seishun
    closed this as completedon Oct 15, 2016
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.windowsIssues and PRs related to the Windows platform.

    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.