diff --git a/Sources/FoundationEssentials/FileManager/FileManager+Files.swift b/Sources/FoundationEssentials/FileManager/FileManager+Files.swift index b2666ccbc..90e9e7472 100644 --- a/Sources/FoundationEssentials/FileManager/FileManager+Files.swift +++ b/Sources/FoundationEssentials/FileManager/FileManager+Files.swift @@ -741,8 +741,12 @@ extension _FileManagerImpl { let blockSize = UInt64(result.f_bsize) #else let fsNumber = result.f_fsid + #if canImport(Glibc) + let blockSize = fsblkcnt_t(result.f_frsize) // support 64-bit block sizes on 32-bit platforms + #else let blockSize = UInt(result.f_frsize) #endif + #endif var totalSizeBytes = result.f_blocks * blockSize var availSizeBytes = result.f_bavail * blockSize var totalFiles = result.f_files @@ -963,6 +967,12 @@ extension _FileManagerImpl { #endif } + #if canImport(Glibc) + // support for 64-bit timestamps on 32-bit platforms; unfortunately + // suseconds_t is not an alias of the appropriate type, but time_t is + typealias suseconds_t = time_t + #endif + if let date = attributes[.modificationDate] as? Date { let (isecs, fsecs) = modf(date.timeIntervalSince1970) if let tv_sec = time_t(exactly: isecs),