USF-OS / FogOS

Other
0 stars 48 forks source link

Adding the locate command #74

Open jlazaro2 opened 1 month ago

jlazaro2 commented 1 month ago

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 commented 1 month ago

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.