-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Split FileManager into Platform Dependent Files #2057
Conversation
b7d5af6
to
695f666
Compare
Might be worth moving |
@swift-ci test |
Foundation/FileManager+POSIX.swift
Outdated
#endif | ||
return urls | ||
} | ||
internal func _urls(for directory: SearchPathDirectory, in domainMask: SearchPathDomainMask) -> [URL] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the per-OS helper functions should be private
instead of internal
where possible`. These are probably a holdover from when they were first written but may as well fix them now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe most of these need to be internal instead of private since they are used in a file they aren't defined in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, good point.
Foundation/FileManager+POSIX.swift
Outdated
|
||
return urls | ||
} | ||
internal func _createDirectory(atPath path: String, withIntermediateDirectories createIntermediates: Bool, attributes: [FileAttributeKey : Any]? = [:]) throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a separating blank line between functions
Foundation/FileManager+POSIX.swift
Outdated
throw _NSErrorWithErrno(errno, reading: false, path: path) | ||
} | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs indentation.
Foundation/FileManager+POSIX.swift
Outdated
return | ||
} | ||
|
||
if rmdir(path) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to have lost its _fileSystemRepresentation
wrapper from #1994. Did you base this split on the latest version from master
?
|
@swift-ci test |
I think the following can be moved into
and wrapped inside a |
Moved, though not in an |
@swift-ci please test |
@jmittert I'm okay taking this if you fix the conflicts with the things that are landing. |
Alright, rebased! |
@swift-ci test |
@swift-ci please test |
These both failed on the Swift test suite
These don't somehow rely on foundation at all do they? |
@jmittert The tests have been failing for most of the PRs for unrelated reasons |
@swift-ci please test |
Splits the Windows and POSIX specific File Manager implementations into their own files. See #2002 (comment)
Not sure if there's a way to make the diff more readable, but in general, what I've done is copy over the function to win32/POSIX, prefixed the name with an underscore, removed the non applicable #if branch, and have the FileManager version pass through to it.