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

Silently fail to 'enter' regular files #654

Merged
merged 3 commits into from
Jul 17, 2023

Conversation

duganchen
Copy link
Contributor

Silently fail to "Enter" regular files. Entering only makes sense for directories.

This fixes #653 (comment)

I don't know Rust at all, so I make no claims to the code quality. But I have tested this change and it does work.

@duganchen duganchen force-pushed the do_not_spam_can_not_enter_file branch from 32598f6 to 5626422 Compare July 17, 2023 05:46
@sayanarijit
Copy link
Owner

I think we can use focused_node's built-in is_dir and symlink.is_dir, without needing a system call.

@duganchen
Copy link
Contributor Author

duganchen commented Jul 17, 2023

I changed it to use focused_node().is_dir() and tested it. With both regular files and directories, and with symlinks of regular files and directories.

src/app.rs Outdated Show resolved Hide resolved
@sayanarijit sayanarijit merged commit 567a620 into sayanarijit:dev Jul 17, 2023
6 of 7 checks passed
@sayanarijit
Copy link
Owner

Thanks.

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.

"Error) could not enter" ...: Not a directory (os error 20)"
2 participants