DroidFS/app/src/main/java/sushi/hardcore/droidfs/filesystems/Stat.kt

17 lines
458 B
Kotlin
Raw Normal View History

2022-06-18 21:13:16 +02:00
package sushi.hardcore.droidfs.filesystems
2023-09-06 19:27:41 +02:00
class Stat(mode: Int, var size: Long, val mTime: Long) {
2022-06-18 21:13:16 +02:00
companion object {
2023-09-06 19:27:41 +02:00
private const val S_IFMT = 0xF000
2022-06-18 21:13:16 +02:00
const val S_IFDIR = 0x4000
const val S_IFREG = 0x8000
const val S_IFLNK = 0xA000
2023-09-06 19:27:41 +02:00
const val PARENT_FOLDER_TYPE = 0xE000
2022-06-18 21:13:16 +02:00
fun parentFolderStat(): Stat {
return Stat(PARENT_FOLDER_TYPE, -1, -1)
}
}
2023-09-06 19:27:41 +02:00
val type = mode and S_IFMT
2022-06-18 21:13:16 +02:00
}