Wow, not truncating would be very confusing. Please open a PR. On Fri, Apr 21, 2017 at 3:36 PM, Enno <[email protected]> wrote:
> Hi Hakkars, > > The file my stream created started to look rather funny so I had to dig a > bit. > > The API docs for FileIO.toFile state it "Overwrites existing files by > default.", but that becomes a bit to literally with the default options. > (see http://doc.akka.io/api/akka/2.5/akka/stream/scaladsl/FileIO$.html ) > > def toPath(f: Path, options: Set[StandardOpenOption] = Set(WRITE, > CREATE)) > > For an existing file with options WRITE, CREATE the new content will > overwrite the file's content from the file's start, but not truncate the > old contents. So in case less content is written in later runs the old > content will follow the new content. > > Wouldn't it be more intuitive (and more according to the docs) to use > WRITE, CREATE, TRUNCATE_EXISTING as default options? > (see https://docs.oracle.com/javase/8/docs/api/java/nio/ > file/StandardOpenOption.html ) > > Cheers, > Enno. > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/ > current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Akka Tech Lead Lightbend <http://www.lightbend.com/> - Reactive apps on the JVM Twitter: @patriknw -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
