pekko/akka-docs/src/main/paradox/stream/operators/FileIO/toFile.md
Ignasi Marimon-Clos 0e7bce7bae The automatic replacement produces Markdown that caused the paradox task in sbt to timeout or event fail. So
this commit removes some operators with outpu too complex:

- ignored operators:
          "ask.md",
          "alsoTo.md",
          "batchWeighted.md",
          "buffer.md",
          "actorRef.md",
          "collect.md",
          "collection.md",
          "combine.md",
          "completionTimeout.md",
          "concat.md",
          "from.md",
          "fromMaterializer.md",
          "map.md",
          "merge.md",
          "queue.md",
          "log.md", // too many overloads, breaks `paradox` task
          "throttle.md", // too many overloads, breaks `paradox` task
          "idleTimeout.md", // too many overloads, breaks `paradox` task
          "setup.md",
          "watch.md",
          "withBackoff.md",
          "zip.md",
          "zipWith.md",
          "actorRefWithBackpressure.md"

- Ignored class when FQCN contains: Implicits, FlowOpsMat, SubSource, FlowOps, SubFlow, WithContext, DelayStrategy

- some extra manual cleanup on the committed operators.
2020-04-28 19:21:04 +02:00

922 B

FileIO.toFile

Create a sink which will write incoming ByteString s to a given file.

@refFile IO Sinks and Sources

@@@ warning

The toFile operator has been deprecated, use @ref:toPath instead.

@@@

Signature

@apidocFileIO.toFile { scala="#toFile(f:java.io.File,options:Set[java.nio.file.OpenOption]):akka.stream.scaladsl.Sink[akka.util.ByteString,scala.concurrent.Future[akka.stream.IOResult]]" java="#toFile(java.io.File,java.util.Set)" }

Description

Creates a Sink which writes incoming ByteString elements to the given file path. Overwrites existing files by truncating their contents as default. Materializes a @scala[Future] @java[CompletionStage] of IOResult that will be completed with the size of the file (in bytes) at the streams completion, and a possible exception if IO operation was not completed successfully.