SyntaxFix
Write A Post
Hire A Developer
Questions
If you are anyways having Akka Streams in your project, it provides a one-liner:
def writeToFile(p: Path, s: String)(implicit mat: Materializer): Unit = { Source.single(ByteString(s)).runWith(FileIO.toPath(p)) }
Akka docs > Streaming File IO