Skip to content

Commit c49db21

Browse files
committed
Foundation: populate the .creationDate attribute on Windows
Ensure that we pass along the creation date from `stat` when querying the attributes of an item. This was being dropped resulting in the creation date for files being unavailable. Partially addresses SR-13617
1 parent 76068b8 commit c49db21

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/Foundation/FileManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ open class FileManager : NSObject {
544544
result[.creationDate] = creationDate
545545
#else
546546
let s = try _lstatFile(atPath: path)
547+
result[.creationDate] = s.st_ctime
547548
#endif
548549

549550
result[.size] = NSNumber(value: UInt64(s.st_size))

0 commit comments

Comments
 (0)