Skip to content

Update FileManager for use by SCL-F #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2024

Conversation

jmschonfeld
Copy link
Contributor

There are two pieces of FileManager that need to be updated so that swift-corelibs-foundation can use this FileManager implementation:

  1. When providing file attributes, many call-sites provide numeric attributes as SCL-F's NSNumber type. However, since swift-foundation does not know about NSNumber, it currently doesn't work. NSNumber is implicitly bridged to concrete numeric types, but not to an existential type like any BinaryInteger. So to fix this, when reading numeric attributes we now try a direct dynamic cast to the target type (as? T) which will succeed if value is an NSNumber, then we try a dynamic cast to any BinaryInteger to catch any other numeric types
  2. User directories provided by XDG configuration files can be absolute or relative, but the current implementation assumes they are always relative. This change supports absolute paths.

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit db63ab3 into swiftlang:main May 15, 2024
@jmschonfeld jmschonfeld deleted the scf-fm-updates branch June 14, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants