You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following REPL session, res1 clearly is wrong, it should be equivalent to res2. This only seems to happen with RNPair. Using NewLine or CarriageReturn seems fine.
The version of scala-io I used is 0.4.2.
Welcome to Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_38).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scalax.file.Path
import scalax.file.Path
scala> import scalax.io.Line.Terminators.RNPair
import scalax.io.Line.Terminators.RNPair
scala> val f = Path.createTempFile()
f: scalax.file.defaultfs.DefaultPath = Path(/tmp/_UBQ4rn7147447547355346080.tmp)
scala> f.writeStrings(Seq("abc","def"), RNPair sep)
scala> f.lines(RNPair).toList
res1: List[String] = List(abc, d)
scala> f.lines().toList
res2: List[String] = List(abc, def)
The text was updated successfully, but these errors were encountered:
scala>importLine.Terminators.Custom
scala>importjava.io.StringReader
scala>valresource=Resource.fromReader(newStringReader("foo**bar**bogus"))scala> resource.string
res4:String= foo**bar**bogus
scala>// read each segment ending in ** but do not include **|vallines= resource.lines(terminator=Custom("**"), includeTerminator=false)
lines: scalax.io.LongTraversable[String] =LongTraversable(...)
scala> lines.toList
res6:List[String] =List(foo, bar, bog)
In the following REPL session,
res1
clearly is wrong, it should be equivalent tores2
. This only seems to happen withRNPair
. UsingNewLine
orCarriageReturn
seems fine.The version of scala-io I used is 0.4.2.
The text was updated successfully, but these errors were encountered: