diff --git a/Sources/Hummingbird/Files/FileMiddleware.swift b/Sources/Hummingbird/Files/FileMiddleware.swift index f3f2a9b40..dad026f6b 100644 --- a/Sources/Hummingbird/Files/FileMiddleware.swift +++ b/Sources/Hummingbird/Files/FileMiddleware.swift @@ -12,11 +12,7 @@ // //===----------------------------------------------------------------------===// -#if os(Linux) -@preconcurrency import Foundation -#else import Foundation -#endif import HTTPTypes import Logging import NIOCore diff --git a/Sources/Hummingbird/Files/LocalFileSystem.swift b/Sources/Hummingbird/Files/LocalFileSystem.swift index 52f01198f..82472db2c 100644 --- a/Sources/Hummingbird/Files/LocalFileSystem.swift +++ b/Sources/Hummingbird/Files/LocalFileSystem.swift @@ -66,7 +66,11 @@ public struct LocalFileSystem: FileProvider { do { let lstat = try await self.fileIO.fileIO.lstat(path: path) let isFolder = (lstat.st_mode & S_IFMT) == S_IFDIR + #if os(Linux) + let modificationDate = Double(lstat.st_mtim.tv_sec) + (Double(lstat.st_mtim.tv_nsec) / 1_000_000_000.0) + #else let modificationDate = Double(lstat.st_mtimespec.tv_sec) + (Double(lstat.st_mtimespec.tv_nsec) / 1_000_000_000.0) + #endif return .init( isFolder: isFolder, size: numericCast(lstat.st_size),