-
Notifications
You must be signed in to change notification settings - Fork 25
Adding "cmp" #31
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
base: main
Are you sure you want to change the base?
Adding "cmp" #31
Conversation
|
I am code reviewing this (as the code review ethics dictate) |
|
Verification Testing Code Walkthrough 2.) compare_files(), Getting 1 char from the file at a time may result in many syscalls being made with each use of the read() func. Alternatively, can read larger chunks of bytes at a time (ex. 128 bytes) and store in two large buffers and then compare bytes one by one. 2a.) The buffers can be refilled once empty and additionally, if there is a size mismatch between them afterwards, then it’s indicative of the files not being the same (mismatched sizes). 3.) Additionally for main(), could have a more “graceful” exit with print statements to match than just exit(result), as if something goes wrong, the user has more information about it. Formatting Overall High Level Checks:
Code Checks:
|
|
I am going to review this PR. |
|
Verification: Testing (in xv6):
Code Walkthrough: Formatting: Small suggestion: fs.img: mkfs/mkfs README.md $(UPROGS) tests
mkfs/mkfs fs.img README.md $(UPROGS) testsHigh Level Checks:
Code Checks:
|
|
I can understand why folks don't like that it doesn't print anything when there's a mismatch, but that is expected behavior. The way you can tell whether it was the same or not is to look at the exit status of the program. This works well, does not have any limitations, and meets the requirements. Great work! I agree with the comment re: system calls being excessive here. But that's something someone could tackle in the future. 5/5 |

Turing in project to add "cmp" functionality.
Contains: