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

Fix "No such file or directory (os error 2)" #4

Merged
merged 2 commits into from Apr 9, 2022

Conversation

rumia-san
Copy link
Contributor

Fixes #2

It seems that after the function call handle.await_complete();, the threads were exetuted and the folders has been already deleted.

However, the following lines https://github.com/XtremeDevX/turbo-delete/blob/0.0.1/src/main.rs#L108-L135 still tried to access the deleted folders and it reports IO error.

So I check whether the path exists before iterating the path again.

BTW, I have done some small code refactoring, extracted a new function : )


Before Fix:
Screenshot 2022-04-09 165337

After fix:
Screenshot 2022-04-09 173532

@suptejas
Copy link
Owner

suptejas commented Apr 9, 2022

Great job on this PR, do you have benchmarks for before vs after this implementation for speed? We need to make sure it doesn't have a big speed impact :)

@rumia-san
Copy link
Contributor Author

Great job on this PR, do you have benchmarks for before vs after this implementation for speed? We need to make sure it doesn't have a big speed impact :)

For my benchmarks, the speed with and without my code change were almost the same. So the speed impact should be small.

图片

BTW, I used cargo build --release to build the binaries, but even I built your repo without any code changes, the exe is still bigger than your "td.exe". I'm confused.
So I didn't update the binaries under the "bin" folder since the binary built by me is a llitle bigger. Sorry for the incovinience...

@suptejas suptejas merged commit bc563a1 into suptejas:master Apr 9, 2022
@rumia-san rumia-san deleted the fix_io_error branch April 9, 2022 16:20
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 IO error for operation on TESTDIRTOBLAST: No such file or directory (os error 2)
2 participants