Open
Description
- Version: v14.15.3
- Platform: Windows
- Subsystem: fs
What steps will reproduce the bug?
- Install an app from the Microsoft Store like PowerShell, PowerShell Preview, or Python.
- Run the following in Node.js:
// 1
fs.statSync("C:\\Users\\tyleonha\\AppData\\Local\\Microsoft\\WindowsApps\\pwsh.exe")
// 2
fs.existsSync("C:\\Users\\tyleonha\\AppData\\Local\\Microsoft\\WindowsApps\\pwsh.exe")
How often does it reproduce? Is there a required condition?
100% repro rate
What is the expected behavior?
// 1
Stats {
dev: 2191433689,
mode: 33206,
nlink: 1,
uid: 0,
gid: 0,
rdev: 0,
blksize: 4096,
ino: 2251799813690117,
size: 6,
blocks: 0,
atimeMs: 1609796639210.8977,
mtimeMs: 1609794509320.4253,
ctimeMs: 1609794563739.3364,
birthtimeMs: 1609794509315.4263,
atime: 2021-01-04T21:43:59.211Z,
mtime: 2021-01-04T21:08:29.320Z,
ctime: 2021-01-04T21:09:23.739Z,
birthtime: 2021-01-04T21:08:29.315Z
}
// 2
true
What do you see instead?
// 1
Uncaught:
Error: EACCES: permission denied, stat 'C:\Users\tyleonha\AppData\Local\Microsoft\WindowsApps\pwsh.exe'
at Object.statSync (fs.js:1086:3) {
errno: -4092,
syscall: 'stat',
code: 'EACCES',
path: 'C:\\Users\\tyleonha\\AppData\\Local\\Microsoft\\WindowsApps\\pwsh.exe'
}
// 2
false
Additional information
This only seems to happen with AppExecLink reparse points on Windows. Regular SymbolicLinks are fine on Windows and give the expected behavior.
Also, fs.lstatSync
works with these AppExecLink's which I'm guessing is because lstat operates on the symlnk and not the file that the symlnk points to.
Related issues:
#33024
microsoft/vscode#95828