From 84eae084a8b0fe71a007a5cdf386d1c1ad62739c Mon Sep 17 00:00:00 2001 From: scratko Date: Tue, 12 Aug 2025 04:11:34 +0300 Subject: Added README --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2b1dfa5 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# Recursive File Finder + +This is a simple command-line utility written in C that recursively searches for +files or directories by name starting from the current directory (`./`). + +## Features + +- Recursive search through all subdirectories. +- Supports searching for both files and directories by exact name. +- Dynamically grows internal buffer to handle deep directory structures. +- Prints full relative paths to all matching entries. +- Minimal dependencies, uses POSIX directory APIs (`opendir`, `readdir`, etc). + +## How It Works + +- Starts scanning from the current directory (`./`). +- For each directory entry, checks if the name matches the target. +- If a directory is found (other than `.` and `..`), descends recursively. +- Uses a dynamically allocated buffer to build relative paths during recursion. +- Prints the relative path to each found file or directory matching the input name. + +## Limitations + +- Only searches relative to the directory where the program is run. +- Matches are case-sensitive. +- No support for symbolic links or special file types. +- Does not support wildcards or partial matches. + +## Usage + +```bash +git clone https://git.scratko.xyz/file-finder +cd file-finder +gcc -Wall file_finder.c -o file_finder +./file_finder +``` +### Example + +```bash +./file_finder README.md +``` -- cgit v1.2.3