https://github.com/andrewbrey/deno_symlink_stat_issue
Reproduction of Deno issue when stat-ing symlinks on Linux
https://github.com/andrewbrey/deno_symlink_stat_issue
Last synced: 4 months ago
JSON representation
Reproduction of Deno issue when stat-ing symlinks on Linux
- Host: GitHub
- URL: https://github.com/andrewbrey/deno_symlink_stat_issue
- Owner: andrewbrey
- Created: 2023-02-10T18:41:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-10T19:01:06.000Z (over 2 years ago)
- Last Synced: 2025-01-17T13:51:19.017Z (5 months ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reproduction of issue with `Deno.stat[Sync]` and `Deno.lstat[Sync]` on symlinks
Deno Repository Issue: https://github.com/denoland/deno/issues/17723
To reproduce the issue, run `deno task run` (or execute `deno run --allow-read --allow-write example.ts`)
This code directly creates a (hard) link pointing to `example.ts` and then immediately tests if that file is a symlink, and reports that it is not. You can do the same with a manually created symlink (since Deno.link[Sync] creates hard links):
```sh
# assuming you test from a not-Windows machine
ln -sf $PWD/example.ts $PWD/symlink.ts
deno eval "console.log(Deno.statSync('symlink.ts').isSymlink)"
deno eval "console.log(Deno.lstatSync('symlink.ts').isSymlink)" # <-- this one *does* produce the correct result
```and observe that, again, `isSymlink` on the resulting `FileInfo` object is `false`.
## Notes / Environment
```
deno --version
deno 1.30.3 (release, x86_64-unknown-linux-gnu)
v8 10.9.194.5
typescript 4.9.4OS: Pop!_OS 22.04 LTS x86_64 (Linux)
VS Code Version: 1.75.1
```