write

object write

Write some data to a file. This can be a String, an Array[Byte], or a Seq[String] which is treated as consecutive lines. By default, this fails if a file already exists at the target location. Use write.over or write.append if you want to over-write it or add to what's already there.

class Object
trait Matchable
class Any
write.type

Type members

Classlikes

object append

Identical to write, except if the file already exists, appends to the file instead of error-ing out

Identical to write, except if the file already exists, appends to the file instead of error-ing out

object channel extends Path => SeekableByteChannel

Opens a SeekableByteChannel to write to the given file.

Opens a SeekableByteChannel to write to the given file.

object over

Similar to os.write, except if the file already exists this over-writes the existing file contents. You can also pass in truncate = false to avoid truncating the file if the new contents is shorter than the old contents, and an offset to the file you want to write to.

Similar to os.write, except if the file already exists this over-writes the existing file contents. You can also pass in truncate = false to avoid truncating the file if the new contents is shorter than the old contents, and an offset to the file you want to write to.

Value members

Concrete methods

def apply(target: Path, data: Source, perms: PermSet, createFolders: Boolean): Unit
def outputStream(target: Path, perms: PermSet, createFolders: Boolean, openOptions: Seq[OpenOption]): OutputStream

Open a java.io.OutputStream to write to the given file

Open a java.io.OutputStream to write to the given file

def write(target: Path, data: Source, flags: Seq[StandardOpenOption], perms: PermSet, offset: Long): AnyVal

Performs the actual opening and writing to a file. Basically cribbed from java.nio.file.Files.write so we could re-use it properly for different combinations of flags and all sorts of Sources

Performs the actual opening and writing to a file. Basically cribbed from java.nio.file.Files.write so we could re-use it properly for different combinations of flags and all sorts of Sources