Ticket #4317 (add documentation to IODeviceType)

Hi,
The conversation originally in glasgow-haskell-users.
---------- Forwarded message ----------
From: Dimitry Golubovsky
The FD implementation of Handles never makes a Handle with an IODeviceType of Directory, because openFile is specified to raise an exception when applied to a directory.
Yes, that was the only place in the Libraries' code I found that mentions this device type (which means I haven't missed anything ;)
Alternatively we could give it a meaning as you suggest - newline-separated file names seems like a reasonable interpretation.
It looks like there is no comments in the code for the definition of IODeviceType. I have created a ticket #4317 http://hackage.haskell.org/trac/ghc/ticket/4317 providing the code comments proposed. -- Dimitry Golubovsky Anywhere on the Web

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 9/15/10 09:08 , Dimitry Golubovsky wrote:
On 9/15/10, Simon Marlow
wrote: Alternatively we could give it a meaning as you suggest - newline-separated file names seems like a reasonable interpretation.
FWIW I would either not give openFile(directory) a meaning, or map it to opendir() instead of providing a different meaning. Possibly IODeviceType Directory could simply replace open() with opendir(), read() with readdir(), etc. (Note that readdir() returns an (inum,filename) tuple.) - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkySSBsACgkQIn7hlCsL25X8BgCfYJ8HN4noSO0pTtnczH3MQSTr tMAAn3fBd7vcMbCJzNJpGd0HyMN5otQ/ =zJlW -----END PGP SIGNATURE-----
participants (2)
-
Brandon S Allbery KF8NH
-
Dimitry Golubovsky