-
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
Implement _contentsEqual on Windows #2411
Implement _contentsEqual on Windows #2411
Conversation
@swift-ci please test linux |
guard DWORD(FILE_ATTRIBUTE_REPARSE_POINT) & path1Attrs == DWORD(FILE_ATTRIBUTE_REPARSE_POINT) | ||
&& DWORD(FILE_ATTRIBUTE_REPARSE_POINT) & path2Attrs == FILE_ATTRIBUTE_REPARSE_POINT else { | ||
return false | ||
} |
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.
Huh? What am I missing? Isn't this the condition that is in the if
?
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.
The inner one is &&
, the outer is ||
. If either is a reparse point, go into the if
, but if one is not a reparse point, the immediately bail out. Sadly there's no logical XOR which might make that clearer.
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.
Hmm, does ^
not work here?
Compared to the POSIX implementation, this: - Uses the same _compareFile and _compareDirectory utilities. - Implements Symlink comparison with `_destinationOfSymbolicLink` - Doesn't handle devices since there's no reasonable way to check for that equivalence on Windows (as far as I'm aware). If given a device, it will instead always return false. This is probably fine since devices tend to be less file like on Windows anyways.
bd2efc8
to
6bc00b2
Compare
@millenomi - any additional comments from you? |
@swift-ci please test Linux |
@swift-ci please test linux |
1 similar comment
@swift-ci please test linux |
I think that all the review comments have been addressed, lets get this merged. |
Compared to the POSIX implementation, this:
_destinationOfSymbolicLink
that equivalence on Windows (as far as I'm aware). If given a device, it
will instead always return false. This is probably fine since devices
tend to be less file like on Windows anyways.