- From: Robert O'Callahan <robert@ocallahan.org>
- Date: Tue, 25 Sep 2007 17:45:49 +1200
On 9/23/07, Maciej Stachowiak <mjs at apple.com> wrote: > > Obviously, if the way to get the contents as text requires providing > the encoding, then it has to be a method. My comment was about the no- > argument methods. But you have a point that reading from disk is not a > simple get operation. Probably the methods should have names based on > read or the like (read(), readAsText(), etc) to indicate this. Also, > they should arguably be asynchronous since reading from the disk can > be slow, especially for large files, and it is undesirable to block > the main thread. For small files, synchronous reading is OK. Perhaps there should be a separate whiz-bang asynchronous API ... it could support partial reads too. Also, I'm not sure how a web app can be expected to know the encoding > of a text file on disk. The same way that any other app does --- guess based on the extension and expected usage? --- now that we've all standardized on meta-data-less file systems :-(. I suppose an app could examine the first chunk of the file and then re-read the file with a better guess. Rob -- "Two men owed money to a certain moneylender. One owed him five hundred denarii, and the other fifty. Neither of them had the money to pay him back, so he canceled the debts of both. Now which of them will love him more?" Simon replied, "I suppose the one who had the bigger debt canceled." "You have judged correctly," Jesus said. [Luke 7:41-43] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070925/c70ac3a8/attachment.htm>
Received on Monday, 24 September 2007 22:45:49 UTC