writeFile

Writes contents to the file located at path. If create is true, then file is created if it does not exist. For binary files, use encoding = ContentEncoding.Base64.

  • Returns true if operation is successful, otherwise false.

common
fun writeFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
fun writeFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
fun writeFile(path: String, contents: ByteArray, create: Boolean): Boolean
fun writeFile(pathComponent: PathComponent, contents: ByteArray, create: Boolean): Boolean
fun writeFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
fun writeFile(path: String, contents: ByteArray, create: Boolean): Boolean
fun writeFile(pathComponent: PathComponent, contents: ByteArray, create: Boolean): Boolean

Writes contents to the file located at path. If create is true, then file is created if it does not exist. For binary files, use encoding = ContentEncoding.Base64.

  • Returns true if operation is successful, otherwise false.

js
fun writeFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean

Writes contents to the file located at pathComponent. If create is true, then file is created if it does not exist. For binary files, use encoding = ContentEncoding.Base64. Returns true if operation is successful, otherwise false.

common
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean

Writes contents to the file located at pathComponent. If create is true, then file is created if it does not exist. For binary files, use encoding = ContentEncoding.Base64. Returns true if operation is successful, otherwise false.

js
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean

Writes contents to the file located at path. If create is true, then file is created if it does not exist. Returns true if operation is successful, otherwise false.

common
fun writeFile(path: String, contents: ByteArray, create: Boolean): Boolean

Writes contents to the file located at pathComponent. If create is true, then file is created if it does not exist. Returns true if operation is successful, otherwise false.

common
fun writeFile(pathComponent: PathComponent, contents: ByteArray, create: Boolean): Boolean