{"id":30358135,"url":"https://github.com/sausk3/filemonitorapp","last_synced_at":"2026-06-15T20:31:39.525Z","repository":{"id":309624567,"uuid":"1036958012","full_name":"sAusk3/FileMonitorApp","owner":"sAusk3","description":"Refer to the About.md","archived":false,"fork":false,"pushed_at":"2025-08-12T22:50:03.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-13T00:10:21.328Z","etag":null,"topics":["cpp","qt6"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sAusk3.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-12T20:55:42.000Z","updated_at":"2025-08-12T22:50:07.000Z","dependencies_parsed_at":"2025-08-13T00:10:26.606Z","dependency_job_id":"38a5767f-5093-4fb3-8e9a-3044c068cc39","html_url":"https://github.com/sAusk3/FileMonitorApp","commit_stats":null,"previous_names":["sausk3/filemonitorapp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sAusk3/FileMonitorApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sAusk3%2FFileMonitorApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sAusk3%2FFileMonitorApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sAusk3%2FFileMonitorApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sAusk3%2FFileMonitorApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sAusk3","download_url":"https://codeload.github.com/sAusk3/FileMonitorApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sAusk3%2FFileMonitorApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271129238,"owners_count":24703880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","qt6"],"created_at":"2025-08-19T09:16:58.555Z","updated_at":"2026-06-15T20:31:39.494Z","avatar_url":"https://github.com/sAusk3.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileMonitorApp\n\nA minimal Qt C++ application that cyclically creates and deletes files in a folder while monitoring its contents using a state machine and threads.\n\n## Features\n- **File Creation Thread**: Cyclically creates files (`file_XXXX.txt`) with minimal text content.\n- **File Deletion Thread**: Deletes the oldest file based on the consecutive number in the filename.\n- **State Machine**: Monitors the directory and updates UI indicators:\n  - Green: 1–20 files.\n  - Red: 0 files.\n  - Orange: \u003e20 files.\n- **UI**:\n  - Button to choose the folder for file operations.\n  - Button to start/stop file creation/deletion.\n  - Button to select and open a file in the default text editor.\n  - Dashboard showing status (color indicator and file count) and a list of files.\n  - Spin boxes to adjust creation/deletion intervals (1000–10000 ms).\n\n## Prerequisites\n- **Qt**: Install Qt 5 or 6 (e.g., via [Qt Online Installer](https://www.qt.io/download)).\n- **VS Code**: Install Visual Studio Code.\n- **C++ Compiler**: Ensure a C++ compiler (e.g., Clang) is installed (comes with Xcode on macOS).\n- **CMake or qmake**: qmake is used by default (included with Qt).\n\n## Project Structure\n- `src/`:\n  - `main.cpp`: Application entry point.\n  - `MainWindow.cpp/h`: Main UI window with buttons, dashboard, and interval controls.\n  - `FileCreator.cpp/h`: Thread for cyclic file creation.\n  - `FileDeleter.cpp/h`: Thread for cyclic file deletion.\n  - `FolderMonitor.cpp/h`: State machine for monitoring folder contents.\n- `FileMonitorApp.pro`: Qt project file for qmake.\n- `README.md`: This file.\n\n## Usage\n- **Choose Folder**: Click \"Choose Folder\" to select a directory for file operations (defaults to `monitored_folder` in the project directory).\n- **Start/Stop Operations**: Click \"Start Operations\" to begin file creation/deletion; click \"Stop Operations\" to pause.\n- **Open File**: Click \"Open File\" to select and open a `.txt` file from the monitored folder in the default text editor.\n- **Dashboard**: Shows the status (color indicator and file count) and a list of files in the monitored folder.\n- **Adjust Intervals**: Use the spin boxes to set creation/deletion intervals (1000–10000 ms). Default for Creation is 1000ms and Deletion is 5000ms\n\n## Notes\n- The application uses QThread for file creation/deletion and QStateMachine for monitoring.\n- Files are created as `file_XXXX.txt` (e.g., `file_0001.txt`) and deleted in order.\n- The folder must have write permissions for file operations to succeed.\n\n## Setting Up and Running in VS Code on macOS\n1. **Install Qt**:\n   - Download and install Qt from [www.qt.io](https://www.qt.io).\n   - Choose a Qt version (e.g., Qt 5.15 or 6.x) and install qmake.\n   - Note the Qt installation path (e.g., `/Users/youruser/Qt/5.15.2/clang_64`).\n\n2. **Install VS Code**:\n   - Download and install VS Code from [code.visualstudio.com](https://code.visualstudio.com).\n   - Install the following extensions:\n     - **C/C++** (by Microsoft)\n     - **Qt Tools** (optional, for Qt-specific features)\n\n3. **Set Up the Project**:\n   - Clone or create the project directory (`FileMonitorApp`) with the provided structure.\n   - Ensure all files are placed as per the structure above.\n\n4. **Configure VS Code**:\n   - Open the `FileMonitorApp` folder in VS Code.\n   - Create a `tasks.json` file in `.vscode/` to build the project:\n     ```json\n     {\n         \"version\": \"2.0.0\",\n         \"tasks\": [\n             {\n                 \"label\": \"Build with qmake\",\n                 \"type\": \"shell\",\n                 \"command\": \"/Users/youruser/Qt/5.15.2/clang_64/bin/qmake FileMonitorApp.pro \u0026\u0026 make\",\n                 \"group\": {\n                     \"kind\": \"build\",\n                     \"isDefault\": true\n                 },\n                 \"problemMatcher\": [\"$gcc\"]\n             }\n         ]\n     }\n     ```\n     - Replace `/Users/youruser/Qt/5.15.2/clang_64/bin/qmake` with your Qt qmake path.\n   - Create a `launch.json` file in `.vscode/` to run the application:\n     ```json\n     {\n         \"version\": \"0.2.0\",\n         \"configurations\": [\n             {\n                 \"name\": \"Run FileMonitorApp\",\n                 \"type\": \"cppdbg\",\n                 \"request\": \"launch\",\n                 \"program\": \"${workspaceFolder}/FileMonitorApp\",\n                 \"args\": [],\n                 \"stopAtEntry\": false,\n                 \"cwd\": \"${workspaceFolder}\",\n                 \"environment\": [],\n                 \"externalConsole\": false,\n                 \"MIMode\": \"lldb\"\n             }\n         ]\n     }\n     ```\n\n5. **Build the Project**:\n   - Open the VS Code Command Palette (`Cmd+Shift+P`).\n   - Select `Tasks: Run Build Task` to run the qmake and make commands.\n   - The binary `FileMonitorApp` will be generated in the project directory.\n\n6. **Run the Application**:\n   - Press `F5` or select `Run \u003e Start Debugging` in VS Code to launch the application.\n   - Alternatively, run `./FileMonitorApp` from the terminal in the project directory.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsausk3%2Ffilemonitorapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsausk3%2Ffilemonitorapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsausk3%2Ffilemonitorapp/lists"}