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

Check if a file exists without creating it #25

Closed
KyleMaas opened this issue Jan 16, 2021 · 5 comments
Closed

Check if a file exists without creating it #25

KyleMaas opened this issue Jan 16, 2021 · 5 comments

Comments

@KyleMaas
Copy link

It would be awfully helpful if I had a way to check if a file existed without having to create it.

@mafintosh
Copy link
Collaborator

You can't use f = new RAF(...), f.stat(cb) for that?

@KyleMaas
Copy link
Author

I assumed, based on the constructor being listed as "Create a new file.", that that would mean that the file would then exist and have to be destroy()'d. Is that incorrect?

@mafintosh
Copy link
Collaborator

Ya, the file is created lazily on the first write. We should update the docs to make it more clear

@KyleMaas
Copy link
Author

Gotcha. Yes, that would help. Some of us do in fact RTFM. 😄

@mafintosh
Copy link
Collaborator

Creates only on write now also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants