Skip to content

Fix detecting file as directory on zOS issue #8051#8052

Merged
acozzette merged 3 commits intoprotocolbuffers:masterfrom
mahdi-hm:master
Nov 17, 2020
Merged

Fix detecting file as directory on zOS issue #8051#8052
acozzette merged 3 commits intoprotocolbuffers:masterfrom
mahdi-hm:master

Conversation

@mahdi-hm
Copy link
Contributor

sys/stat.h provides macros like S_ISDIR to test for a directory. The macro S_IFDIR should not be used in this way since it has different result on zOS(Always detecting file as directory as a consequence).

@acozzette
Copy link

@mahdi-hosseini-moghaddam Thank you for sending this fix, but I think the one problem is that Windows doesn't seem to support the S_ISDIR macro. Maybe you could put in an ifdef to keep the old if condition for Windows builds?

@mahdi-hm
Copy link
Contributor Author

mahdi-hm commented Nov 17, 2020

@mahdi-hosseini-moghaddam Thank you for sending this fix, but I think the one problem is that Windows doesn't seem to support the S_ISDIR macro. Maybe you could put in an ifdef to keep the old if condition for Windows builds?

I didn't know that, Thank you for your comment. I will update that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants