Skip to content
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

Availability of SwiftFileManager #909

Open
sebsto opened this issue Sep 9, 2024 · 0 comments
Open

Availability of SwiftFileManager #909

sebsto opened this issue Sep 9, 2024 · 0 comments

Comments

@sebsto
Copy link

sebsto commented Sep 9, 2024

This is a question, not an issue.

I noticed a new signature for function FileManager.fileExists : FileManager.fileExists(atPath path: String, isDirectory: inout Bool) -> Bool which is Swift-friendly and not use ObjCBool anymore.

But when I try to use is with the latest Swift 6 snaphot, it fails with

$ swift --version  
Apple Swift version 6.0-dev (LLVM c3efe9282719c35, Swift b163fed2b3101e0)
Target: arm64-apple-macosx14.0

$ swift build    

45 |             var isDirectory: Bool 
46 |             if FileManager.default.fileExists(atPath: localDepsPath, isDirectory: &isDirectory) {
   |                                                                                   |- error: cannot convert value of type 'UnsafeMutablePointer<Bool>' to expected argument type 'UnsafeMutablePointer<ObjCBool>'
   |                                                                                   `- note: arguments to generic parameter 'Pointee' ('Bool' and 'ObjCBool') are expected to be equal

How can we take advantage of this new function ?

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

No branches or pull requests

1 participant