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

getting file path from Deno.FsFile #23591

Open
teidesu opened this issue Apr 28, 2024 · 0 comments
Open

getting file path from Deno.FsFile #23591

teidesu opened this issue Apr 28, 2024 · 0 comments
Labels
suggestion suggestions for new features (yet to be agreed)

Comments

@teidesu
Copy link

teidesu commented Apr 28, 2024

given a Deno.FsFile, there's currently no way to determine path to it's underlying file system file. i suggest adding some kind of api that would allow that, something along

const file = await Deno.open('file.txt')
assert(file.path == "file.txt")

similar to how it's possible in Node.js:

const file = fs.createReadStream('file.txt')
console.log(file.path) // "file.txt"

this is mostly just a developer experience improvement, as it would allow not having to store path to file separately and just reference it from .path. and it would also allow library developers to accept the handles returned by Deno.open and derive file name directly from them

@marvinhagemeister marvinhagemeister added the suggestion suggestions for new features (yet to be agreed) label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

2 participants