Kotlin File Operations
In this tutorial, we will go through different file or directory operations using Kotlin programming.
Create
Get Properties / Meta
- Kotlin – Get file creation timestamp
- Kotlin – Get file extension
- Kotlin – Get file last modified timestamp
- Kotlin – Get file name
- Kotlin – Get file size
Iterate over files
Checks
- Kotlin – Check if file exists
- Kotlin – Check if file is readable
- Kotlin – Check if file is writable
- Kotlin – Check if directory exists
Read Operations
- Kotlin – Read file
- Kotlin – Read file as list of lines
- Kotlin – Read file character by character
- Kotlin – Read file line by line
- Kotlin – Read file into a string
Write / Update Operations
- Kotlin – Append to text file
- Kotlin – Copy content of a file to another file
- Kotlin – Copy directory
- Kotlin – Copy file
- Kotlin – Move file
- Kotlin – Move directory
- Kotlin – Rename file
- Kotlin – Rename directory
- Kotlin – Replace specific string in file
- Kotlin – Write to File
Delete Operations
Conclusion
In this Kotlin Tutorial, we have gone through different File Operations in Kotlin programming language.