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

use stat instead of lstat on files and directories #1302

Merged
merged 1 commit into from
May 4, 2024

Conversation

hundertzwei
Copy link
Contributor

lstat does not follow symlinks, so if you have a directory symlinked, my_existsdir tells us, it does not exists.

use S_ISREG (== file) instead of !S_ISDIR (==not directory) on regular files. There are more inode-types than files and directories.

Fixes # .

Changes proposed in this pull request:

@midwan

lstat does not follow symlinks, so if you have a directory symlinked, my_existsdir tells us, it does not exists.

use S_ISREG (== file) instead of !S_ISDIR (==not directory) on regular files. There are more inode-types than files and directories.
@midwan
Copy link
Collaborator

midwan commented May 4, 2024

Good find, thanks!

@midwan midwan merged commit 76e32b3 into BlitterStudio:master May 4, 2024
22 checks passed
midwan pushed a commit that referenced this pull request May 4, 2024
lstat does not follow symlinks, so if you have a directory symlinked, my_existsdir tells us, it does not exists.

use S_ISREG (== file) instead of !S_ISDIR (==not directory) on regular files. There are more inode-types than files and directories.
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.

2 participants