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

Windows: Implement attributesOfItem with _lstat #2016

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

gmittert
Copy link
Contributor

@gmittert gmittert commented Mar 16, 2019

Requires #2015



#if os(Windows)
result[.type] = s.st_mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong as the s.st_mode will include the file permissions, can it be unified with the let type = ... on line 917?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, that was incorrect. It should now properly get the file type.



#if os(Windows)
result[.posixPermissions] = NSNumber(value: UInt64(s.st_mode & ~UInt16(ucrt.S_IFMT)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding an internal helper to mask s.st_mode to file permissions as it seems to be used in a few places.

@gmittert gmittert force-pushed the AttributesBy_lstat branch 2 times, most recently from b556b46 to c8b7627 Compare March 22, 2019 17:42
@spevans
Copy link
Contributor

spevans commented Mar 22, 2019

@swift-ci test

@gmittert gmittert force-pushed the AttributesBy_lstat branch from c8b7627 to 66e42e2 Compare March 25, 2019 16:37
@gmittert
Copy link
Contributor Author

Actually reverted a line that wasn't supposed to be changed. It should compile now...

@compnerd
Copy link
Member

@swift-ci please test

@gmittert gmittert force-pushed the AttributesBy_lstat branch from 66e42e2 to 9dce82c Compare April 1, 2019 20:03
@gmittert
Copy link
Contributor Author

gmittert commented Apr 1, 2019

Alright, fixed the UInt32/UInt16 thing for realsies this time. Should be good to go now.

@gmittert gmittert force-pushed the AttributesBy_lstat branch from 9dce82c to 0ea3e4d Compare April 1, 2019 20:28
@compnerd
Copy link
Member

compnerd commented Apr 2, 2019

@swift-ci please test

@compnerd compnerd merged commit 6b2ef3a into swiftlang:master Apr 3, 2019
@gmittert gmittert deleted the AttributesBy_lstat branch April 15, 2019 20:54
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.

3 participants