mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
refactor(archive): Turn timespec function to extension method
This commit is contained in:
parent
fc87410d46
commit
1a16d84e61
1 changed files with 4 additions and 4 deletions
|
@ -65,10 +65,10 @@ private fun StructStat.toArchiveStat() = ArchiveEntry.StructStat().apply {
|
||||||
stSize = st_size
|
stSize = st_size
|
||||||
stBlksize = st_blksize
|
stBlksize = st_blksize
|
||||||
stBlocks = st_blocks
|
stBlocks = st_blocks
|
||||||
stAtim = timespec(st_atime)
|
stAtim = st_atime.toTimespec()
|
||||||
stMtim = timespec(st_mtime)
|
stMtim = st_mtime.toTimespec()
|
||||||
stCtim = timespec(st_ctime)
|
stCtim = st_ctime.toTimespec()
|
||||||
stIno = st_ino
|
stIno = st_ino
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun timespec(tvSec: Long) = ArchiveEntry.StructTimespec().also { it.tvSec = tvSec }
|
private fun Long.toTimespec() = ArchiveEntry.StructTimespec().also { it.tvSec = this }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue