elvish
elvish copied to clipboard
Missing documentation: fd and name keys for file objects
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
- [X] I agree to follow Elvish's Code of Conduct.
As an aside, doesn't it make more sense to have $file[fd]=$nil when the file is closed?