15 Commits

Author SHA1 Message Date
Saleem Abdulrasool
f89df9d5f3
FoundationEssentials: ensure that the path exists when stat'ing (#647)
On non-Windows targets we ensure that the path exists when we attempt to
query the attributes of the path. This adds the same check on Windows so
that we can have similar behaviour on all platforms.
2024-06-03 10:12:28 -07:00
Jeremy Schonfeld
3297fb33b4
Return file attributes as NSNumbers when SCL-F is imported (#641) 2024-05-29 14:06:38 -07:00
Saleem Abdulrasool
02e110faf6
FoundationEssentials: add type to the file attributes on Windows (#634)
Get the file type using the Win32 APIs and wire that into the attribute
dictionary.
2024-05-28 05:04:37 -07:00
Saleem Abdulrasool
4c26af5c20
FoundationEssentials: drop invalid modification dates (#628)
Follow the expected behaviour to drop invalid modification dates, e.g.
`+NaN`. This matches the semantics that are expected on Unix and avoids
a crash due to the initialiser.
2024-05-21 15:46:33 -07:00
Jeremy Schonfeld
db63ab39bb
(128078561) Fix FileManager bugs found by scl-f (#609) 2024-05-15 11:03:07 -07:00
Saleem Abdulrasool
b80fb683b6
FoundationEssentials: provide typed overloads for constants from WinSDK
This allows for us to use the constants without explicitly casting the
type to `DWORD` on each site of use. By providing the shadowing
overload we can simply use the constants without impacting the
readability of the surrounding code.
2024-04-11 15:53:31 -07:00
Saleem Abdulrasool
b2ba6f6f1c
FoundationEssentials: tweak FileManager utilities for Windows (#537)
Add a helper for time conversion and remove some functions which do not
make sense on Windows - users are not identified by integral IDs but
rather by SIDs. This helps reduce the error diagnostics when building
FoundationEssentials on Windows.
2024-04-10 16:37:03 -07:00
Saleem Abdulrasool
9491cce69c
FoundationEssentials: add some missing imports for Windows (#520)
This allows us to get further into building FoundationEssentials once
again on Windows. Much of the file system work has resulted in this
module no longer being viable on Windows and will need to be replaced to
allow building on Windows which does not have the `fts` APIs.
2024-03-29 14:19:23 -07:00
Jeremy Schonfeld
c1e5321e8d
(125120887) attributesForItem(atPath:) uses FileAttributeType instead of String for .type value 2024-03-21 15:51:16 -07:00
Jeremy Schonfeld
e9a621c6ef
(124077456) FileManager should not crash on malformed modificationDate attribute value 2024-03-13 10:44:59 -07:00
Jeremy Schonfeld
75f2ae99e4
(123713046) FileManager should always return values for immutable/appendOnly attributes
* (123713046) Ensure we always return values for immutable/appendOnly file attributes

* (123713046) Disable test on non-Darwin
2024-03-08 11:25:52 -08:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Jeremy Schonfeld
f28d05ad9d
(122854809) Fix error handling for reading extended attributes 2024-02-13 18:55:36 -08:00
Jeremy Schonfeld
f99560eea6
(122800483) Add missing FOUNDATION_FRAMEWORK import for file protection classes 2024-02-12 10:37:52 -08:00
Jeremy Schonfeld
33856a556d
(120741818) Port FileManager to swift-foundation
* (120741818) Port FileManager to swift-foundation

* (120741818) Fix linux test failures

* (120741818) Fix build failures
2024-02-09 15:03:43 -08:00