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

Missing documentation: fd and name keys for file objects #1830

Open
1 task done
hanche opened this issue Aug 8, 2024 · 1 comment
Open
1 task done

Missing documentation: fd and name keys for file objects #1830

hanche opened this issue Aug 8, 2024 · 1 comment

Comments

@hanche
Copy link
Contributor

hanche commented Aug 8, 2024

What happened, and what did you expect to happen?

I notice that one can get a file descriptor for an open file by indexing: $file[fd]. The value is -1 if the file is closed, which seems to be a good way to tell whether the file is still open. Also, $file[name] contains the filename. However, these keys does not seem to be documented. Unless this feature is slated to go away, I think it would be a good thing to document it.

Output of "elvish -version"

0.21.0-dev.0.20240724150116-9597a25e366b-dirty

Code of Conduct

@hanche
Copy link
Contributor Author

hanche commented Aug 9, 2024

As an aside, doesn't it make more sense to have $file[fd]=$nil when the file is closed?

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

1 participant