back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 41 insertions, 0 deletions
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 <name_to_search>
+```
+### Example
+
+```bash
+./file_finder README.md
+```