File System
A thread safe singleton to access file system apis.
Examples
val documentsDirectory = FileSystem.contentsDirectory
val isFileCreated = FileSystem.touch(documentsDirectory.absolutePath?.byAppending("test.txt")!!)
object FileSystem
Content copied to clipboard
object FileSystem
Content copied to clipboard
object FileSystem
Content copied to clipboard
Functions
appendFile
Link copied to clipboard
fun appendFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun appendFile(path: String, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
copyFile
Link copied to clipboard
fun copyFile(srcPathComponent: PathComponent, destPathComponent: PathComponent): Boolean
Content copied to clipboard
fun copyFile(srcPathComponent: PathComponent, destPathComponent: PathComponent): Boolean
Content copied to clipboard
fun copyFile(srcPathComponent: PathComponent, destPathComponent: PathComponent): Boolean
Content copied to clipboard
equals
Link copied to clipboard
exists
Link copied to clipboard
hashCode
Link copied to clipboard
mkdir
Link copied to clipboard
moveFile
Link copied to clipboard
fun moveFile(srcPathComponent: PathComponent, destPathComponent: PathComponent): Boolean
Content copied to clipboard
fun moveFile(srcPathComponent: PathComponent, destPathComponent: PathComponent): Boolean
Content copied to clipboard
fun moveFile(srcPathComponent: PathComponent, destPathComponent: PathComponent): Boolean
Content copied to clipboard
readDir
Link copied to clipboard
readFile
Link copied to clipboard
fun readFile(pathComponent: PathComponent, encoding: ContentEncoding): String?
Content copied to clipboard
fun readFile(pathComponent: PathComponent, encoding: ContentEncoding): String?
Content copied to clipboard
fun readFile(pathComponent: PathComponent, encoding: ContentEncoding): String?
Content copied to clipboard
fun readFile(pathComponent: PathComponent, encoding: ContentEncoding): String?
Content copied to clipboard
stat
Link copied to clipboard
toString
Link copied to clipboard
touch
Link copied to clipboard
unlink
Link copied to clipboard
writeFile
Link copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: ByteArray, create: Boolean): Boolean
Content copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: ByteArray, create: Boolean): Boolean
Content copied to clipboard
fun writeFile(path: String, contents: ByteArray, create: Boolean): Boolean
Content copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: ByteArray, create: Boolean): Boolean
Content copied to clipboard
fun writeFile(path: String, contents: ByteArray, create: Boolean): Boolean
Content copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
fun writeFile(pathComponent: PathComponent, contents: String, create: Boolean, encoding: ContentEncoding): Boolean
Content copied to clipboard
Properties
cachesDirectory
Link copied to clipboard
Path to caches directory. Directory is guaranteed to exist (created if not exists already).
contentsDirectory
Link copied to clipboard
Path to the common contents directory. Directory is guaranteed to exist (created if not exists already).
On Android, it points to files
directory. On iOS, it points to Documents
directory.
temporaryDirectory
Link copied to clipboard
Path to Temporary directory. Directory is guaranteed to exist (created if not exists already).