elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Missing documentation: fd and name keys for file objects

Open hanche opened this issue 1 year ago • 1 comments

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 avatar Aug 08 '24 18:08 hanche

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

hanche avatar Aug 09 '24 19:08 hanche