back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2025-08-12 04:11:34 +0300
committerscratko <m@scratko.xyz>2025-08-12 04:11:34 +0300
commit84eae084a8b0fe71a007a5cdf386d1c1ad62739c (patch)
tree7d49de7381c83012f5751ab59defa3f34382b615 /README.md
parentc56f26fa2db5e93b6827c9ec991e8c4a95b88743 (diff)
downloadfile-finder-master.tar.gz
file-finder-master.tar.bz2
file-finder-master.zip
Added READMEHEADmaster
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
+```