MultiByteFileStream is terrible (too complex) because it does too much (at once). Let's keep WriteStream simple (and even simplify it). You do not want characters that change magically. That being said, line end conventions can be a pain. In general I would say that you should write either something platform specific (you can fetch the EOL terminator somewhere), or you write something specific (say CRLF for web stuff), while during reading you should accept anything (that is easy to do). You know: be strict in what you produce, liberal in what you accept.
On 26 May 2016, at 11:39, Peter Uhnák <i.uhnak@gmail.com> wrote:
Is there a reason why only MultiByteFileStream provides lineEndConvention: and not WriteStream?
The problem is that if I use MemoryStore in tests it breaks, because DiskStore and MemoryStore return different write streams.
'/tmp/test.txt' asFileReference writeStream ==> "MultiByteFileStream: '/tmp/test.txt'". (FileSystem memory / 'test.txt') writeStream ==> "a WriteStream"
Can we either:
a) have `lineEndConvention:` directly in the WriteStream, or b) have MemoryStore return MultiByteFileStream, or c) both?
Thanks, Peter