Add method to FileSystem to check for file existance#237
Merged
avivbeeri merged 19 commits intodomeengine:developfrom May 10, 2022
Merged
Add method to FileSystem to check for file existance#237avivbeeri merged 19 commits intodomeengine:developfrom
avivbeeri merged 19 commits intodomeengine:developfrom
Conversation
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
avivbeeri
requested changes
May 7, 2022
Collaborator
avivbeeri
left a comment
There was a problem hiding this comment.
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.
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
avivbeeri
requested changes
May 8, 2022
Contributor
Author
|
Oops accidentally committed the changes to the wrong branch again. Fixing that! |
Change to reduce code in FILESYSTEM_doesFileExist and change FILESYSTEM_doesDirectoryExist to return A boolean.
avivbeeri
requested changes
May 9, 2022
Collaborator
avivbeeri
left a comment
There was a problem hiding this comment.
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 :)
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
approved these changes
May 10, 2022
Collaborator
|
Thank you so much for this contribution (and putting up with my review process!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.