From e7c23c135b09feffe674f4721625c28650480e7b Mon Sep 17 00:00:00 2001 From: TapTap Date: Sat, 4 Jul 2026 22:57:58 +0200 Subject: [PATCH] docs: update README with --source-dir/--dest-dir/--save-to-disk and test.py --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d6476f..770d14e 100644 --- a/README.md +++ b/README.md @@ -49,15 +49,18 @@ The client-server communication uses the following status codes: | `-m` | Enable multithreading mode | | `-c [level]` | Enable compression with optional level (1-22, default: 5) | | `-s` | Enable chunk serialization (batch-transfer all files per chunk) | +| `--source-dir ` | Source directory to sync (overrides `FASTSYNC_SOURCE_DIR`) | +| `--dest-dir ` | Server-side destination directory (overrides `FASTSYNC_DEST_DIR`) | +| `--save-to-disk` | Persist received files to disk | ### Environment Variables | Variable | Description | Default | |----------|-------------|---------| -| `FASTSYNC_SOURCE_DIR` | Source directory for files | Current user's documents directory | -| `FASTSYNC_DEST_DIR` | Destination directory | `./data_copied` | +| `FASTSYNC_SOURCE_DIR` | Source directory for files (fallback, overridden by `--source-dir`) | Current user's documents directory | +| `FASTSYNC_DEST_DIR` | Destination directory (fallback, overridden by `--dest-dir`) | `./data_copied` | | `FASTSYNC_SERVER_IP` | Server IP address | `127.0.0.1` | | `FASTSYNC_SERVER_PORT` | Server port | `8080` | -| `FASTSYNC_SAVE_TO_DISK` | Save to disk (true/false) | `false` | +| `FASTSYNC_SAVE_TO_DISK` | Save to disk (fallback, overridden by `--save-to-disk`) | `false` | ## Implementation Details @@ -101,9 +104,12 @@ make ### Client ```bash -# Basic usage +# Basic usage with default settings (sends from ~/Documents/...) ./build/client -m -c 10 +# Specify source and destination directories +./build/client --source-dir /path/to/send --dest-dir /path/to/receive --save-to-disk + # Chunk serialization mode (batch per chunk) ./build/client -s @@ -122,6 +128,14 @@ The project includes comprehensive unit tests for core functionality: ./build/tests ``` +An integration test / benchmark script runs all configurations against ~50 MB of generated test data with byte-for-byte verification: + +```bash +python3 test.py +# Skip the throttled suite (disk I/O limits + 100ms network delay) if sudo is unavailable: +python3 test.py --no-throttled +``` + ## Code Organization ```