Skip to content

Commit c79c658

Browse files
committed
Fix FileItem ID initialization and update modification date retrieval in FileListerPOSIX
1 parent b981636 commit c79c658

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lara/views/FileManagerView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SwiftUI
99
import Foundation
1010

1111
struct FileItem: Identifiable {
12-
let id = UUID()
12+
let id: UUID = UUID()
1313
let name: String
1414
let path: String
1515
let isDirectory: Bool
@@ -46,7 +46,7 @@ class FileListerPOSIX: NSObject {
4646
if lstat(fullPath, &stat_buf) == 0 {
4747
let isDir = (stat_buf.st_mode & S_IFDIR) != 0
4848
let size = UInt64(stat_buf.st_size)
49-
let modDate = Date(timeIntervalSince1970: TimeInterval(stat_buf.st_mtime))
49+
let modDate = Date(timeIntervalSince1970: TimeInterval(stat_buf.st_mtimespec.tv_sec))
5050

5151
let item = FileItem(
5252
name: name,

0 commit comments

Comments
 (0)