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

Adding the locate command #74

Open
jlazaro2 opened this issue Sep 17, 2024 · 1 comment
Open

Adding the locate command #74

jlazaro2 opened this issue Sep 17, 2024 · 1 comment

Comments

@jlazaro2
Copy link

jlazaro2 commented Sep 17, 2024

Partners: Esha Dupuguntla @eshadupz

Command:
The locate command directly searches for the location of files based on the file name. Additional arguments such as -i will accommodate to the filename and print relevant results. For example, -i will ignore upper or lower case of the file.

Plan:
First, the command will be implemented and used in the user’s command line argument to find the requested file name. It should be displayed on the terminal (list printed if multiple matching file names). Accomodate flags as well.

Files:
user/locate.c: Specific functions based on the command and flags to adjust file name results printed
Makefile: Update to compile location.c along with other OS commands.
user/user.h: Add specific functions and argument names.

@malensek
Copy link
Contributor

One distinction for the locate command is it uses a database to search for the files. I'm not sure if you want to go with that approach, but if you'd rather traverse the file system for each invocation then maybe technically this would be implementing find instead. (so basically just a name change).

You can also use the basic regex implementation from grep.c to support pattern matching for this.

Overall sounds like a good project.

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

No branches or pull requests

2 participants