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

Add method to FileSystem to check for file existance #237

Merged
merged 19 commits into from
May 10, 2022

Conversation

8-BIT-DEV
Copy link
Contributor

I saw in the discord server someone was asking about this and though it was A simple enough feature to implement. So I did. The new method is called fileExists in the class FileSystem. It returns true if the file exists and false it not.

8-BIT-DEV added 5 commits May 6, 2022 13:54
To be able to check if file exists using simple function instead of Fiber.try
To check if the file exists it attempts to open the file if it fails the file either doesn't exist or the program does not have the permission to read it.
if ENGINE_readfile and if it fails the file doesn't exist.
to the FileSystem class in IO
Copy link
Collaborator

@avivbeeri avivbeeri left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution. It isn't quite where I'd like it for merging, but it definitely gets close.

Documentation for the new method will also be required before I can merge this.

8-BIT-DEV added 4 commits May 7, 2022 15:20
I accidentally put these on the main branch first read there
I accidentally put these on the main branch first read there
I accidentally put these on the main branch first read there
I accidentally put these on the main branch first read there
@8-BIT-DEV
Copy link
Contributor Author

Oops accidentally committed the changes to the wrong branch again. Fixing that!

Copy link
Collaborator

@avivbeeri avivbeeri left a comment

Choose a reason for hiding this comment

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

There's a few final changes to make, but I'm happier with how this looks, at least from the API design side.

Please also add yourself to the AUTHORS file, so you can be appropriately credited :)

8-BIT-DEV added 4 commits May 9, 2022 14:48
ENGINE_directoryExists now returns A boolean. Duplicate code is removed and replaced by function calls.
Changed it to type dirCheck as boolean. And now directly uses wrenSetSlotBool
@avivbeeri avivbeeri added enhancement New feature or request good first issue Good for newcomers labels May 9, 2022
@8-BIT-DEV 8-BIT-DEV requested a review from avivbeeri May 9, 2022 22:13
@avivbeeri avivbeeri merged commit 52a9f28 into domeengine:develop May 10, 2022
@avivbeeri
Copy link
Collaborator

Thank you so much for this contribution (and putting up with my review process!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants