Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode.workspace.fs.readDirectory() does not get all files (reparse points) under %USERPROFILE%\AppData\Local\Microsoft\WindowsApps #95828

Open
karthiknadig opened this issue Apr 22, 2020 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O nodejs NodeJS support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@karthiknadig
Copy link
Member

karthiknadig commented Apr 22, 2020

(for Python extension use)

  • VSCode Version:1.44.2
  • OS Version: Microsoft Windows 10 [Version 10.0.18362.778]

Steps to Reproduce:

  1. Call vscode.workspace.fs.readDirectory() on "C:\Users\*****\AppData\Local\Microsoft\WindowsApps"

Notes:
image

I am not sure if they are regular symlinks, since dir \a does not show them as symlinks. They seem to be reparse points:

C:\Users\*****\AppData\Local\Microsoft\WindowsApps>dir /a
 Volume in drive C is OSDisk
 Volume Serial Number is CCED-E58F

 Directory of C:\Users\karth\AppData\Local\Microsoft\WindowsApps

04/16/2020  12:51 PM    <DIR>          .
04/16/2020  12:51 PM    <DIR>          ..
04/16/2020  12:51 PM    <DIR>          Backup
03/10/2020  01:15 AM    <DIR>          CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
03/24/2020  07:48 PM                 0 debian.exe
04/14/2020  11:59 PM                 0 GameBarElevatedFT_Alias.exe
04/16/2020  12:51 PM                 0 idle.exe
04/16/2020  12:51 PM                 0 idle3.8.exe
04/16/2020  12:51 PM                 0 idle3.exe
11/09/2019  02:15 AM    <DIR>          Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
11/13/2019  10:09 AM    <DIR>          Microsoft.MicrosoftEdge_8wekyb3d8bbwe
04/14/2020  11:59 PM    <DIR>          Microsoft.XboxGamingOverlay_8wekyb3d8bbwe
11/13/2019  10:09 AM                 0 MicrosoftEdge.exe
04/16/2020  12:51 PM                 0 pip.exe
04/16/2020  12:51 PM                 0 pip3.8.exe
04/16/2020  12:51 PM                 0 pip3.exe
04/16/2020  12:51 PM                 0 python.exe
04/16/2020  12:51 PM                 0 python3.8.exe
04/16/2020  12:51 PM                 0 python3.exe
04/16/2020  12:51 PM    <DIR>          PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0
04/16/2020  12:51 PM                 0 pythonw.exe
04/16/2020  12:51 PM                 0 pythonw3.8.exe
04/16/2020  12:51 PM                 0 pythonw3.exe
03/24/2020  07:48 PM    <DIR>          TheDebianProject.DebianGNULinux_76v4gfsz19hv4
03/10/2020  01:15 AM                 0 ubuntu.exe
              16 File(s)              0 bytes
               9 Dir(s)  42,065,428,480 bytes free
@int19h
Copy link

int19h commented Apr 22, 2020

Far says they're reparse points:

image

@karthiknadig karthiknadig changed the title vscode.workspace.fs.readDirectory() does not get all files under %USERPROFILE%\AppData\Local\Microsoft\WindowsApps vscode.workspace.fs.readDirectory() does not get all files (reparse points) under %USERPROFILE%\AppData\Local\Microsoft\WindowsApps Apr 22, 2020
@jrieken jrieken assigned bpasero and unassigned jrieken Apr 23, 2020
@bpasero
Copy link
Member

bpasero commented Apr 23, 2020

Since I do not have a folder WindowsApps in that directory I tried to reproduce reading from C:\ where Documents and Settings also seems to be a reparse point. I see the folder appearing properly:

image

Using code: console.log(await vscode.workspace.fs.readDirectory(vscode.Uri.parse('file:///c:/')));

@bpasero bpasero added the ~info-needed Issue requires more information from poster (with bot comment) label Apr 23, 2020
@int19h
Copy link

int19h commented Apr 23, 2020

Reparse points are a low-level mechanism that is used to implement a bunch of different things in NTFS - hard links, symlinks, junctions etc. This is a particular variety of reparse point that appears to be specific to the Windows Store, so I don't think this can be reproduced without it.

The folder is probably created lazily when apps are first installed. Try installing Python from the Store: https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l

@bpasero
Copy link
Member

bpasero commented Apr 23, 2020

This seems to be a node.js bug, I can neither lstat nor stat the children of that folder :

> fs.statSync("c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe")                 
Thrown:                                                                                                                  
{ Error: UNKNOWN: unknown error, stat 'c:\Users\bpasero\AppData\Local\Microsoft\WindowsApps\GameBarElevatedFT_Alias.exe' 
    at Object.statSync (fs.js:855:3)                                                                                     
  errno: -4094,                                                                                                          
  syscall: 'stat',                                                                                                       
  code: 'UNKNOWN',                                                                                                       
  path:                                                                                                                  
   'c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe' }                           
> fs.lstatSync("c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe")                
Thrown:                                                                                                                  
{ Error: UNKNOWN: unknown error, lstat 'c:\Users\bpasero\AppData\Local\Microsoft\WindowsApps\GameBarElevatedFT_Alias.exe'
    at Object.lstatSync (fs.js:845:3)                                                                                    
  errno: -4094,                                                                                                          
  syscall: 'lstat',                                                                                                      
  code: 'UNKNOWN',                                                                                                       
  path:                                                                                                                  
   'c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe' }                           
>                                                                                                                        

Can you report it? VSCode needs the stat to know what thing it deals with.

@bpasero bpasero added file-io File I/O nodejs NodeJS support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) and removed info-needed Issue requires more information from poster labels Apr 23, 2020
@karthiknadig
Copy link
Member Author

Reported on node nodejs/node#33024

@TylerLeonhardt
Copy link
Member

New upstream issue: nodejs/node#36790

@bpasero
Copy link
Member

bpasero commented Jan 5, 2021

I cannot recall why I set the "fixed-in-electron-11" label, I assume this is still an issue?

@deepak1556 deepak1556 added the bug Issue identified by VS Code Team member as probable bug label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug file-io File I/O nodejs NodeJS support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

7 participants
@bpasero @deepak1556 @int19h @jrieken @TylerLeonhardt @karthiknadig and others