Kotlin File Operations
In this series of Kotlin tutorials, we shall go through different file operations with examples for each of the operations.
Basic tutorials on Files
The following tutorials cover CRUD operations and checks on files.
- Kotlin – Create file
- Kotlin – Read file
- Kotlin – Delete file
- Kotlin – Copy file
- Kotlin – Check if file is empty
- Kotlin – Check if file exists
Basic tutorials on directories
The following tutorials cover CRUD operations and checks on directories.
- Kotlin – Create directory
- Kotlin – Create directory recursively
- Kotlin – Get all files in a specific directory
- Kotlin – Delete directory
- Kotlin – Copy directory
- Kotlin – Iterate over directory recursively
- Kotlin – Check if directory is empty
- Kotlin – Check if directory exists
Tutorials related to File metadata
The following tutorials deal with meta information like file size, file created date, file modified date, etc.
- Kotlin – Get file extension
- Kotlin – Get file name
- Kotlin – Get file size
- Kotlin – Get file modification date
- Kotlin – Get file creation date
- Kotlin – Get absolute file path
Text file operations
Tutorials on how to create a file using Kotlin.
Tutorials on how to write content to file.
Tutorials on how to read the content from file.
Tutorials on how to access file permissions.
Tutorials on how to perform string operations with the content in files.
- Kotlin – Replace string in file
- Kotlin – Check if a specific string is present in file
- Kotlin – Count words in file
- Kotlin – Count lines in file