Keep Notes is a simple console-based file management program written in C++. The program allows users to perform basic operations on text files, such as creating, editing, viewing, and deleting files. This lightweight and efficient tool is perfect for learning file I/O operations in C++.
- Create Files: Create new text files.
- Edit Files: Append content to existing files.
- Show File Content: Display the content of a file.
- Delete Files: Delete unwanted files.
git clone https://github.com/your-username/keep-notes.git
cd keep-notesTo compile the code, use any C++ compiler. Below is an example using g++:
g++ -o keep_notes keep_notes.cpp./keep_notesAfter running the program, you will see the following options:
Options:
1. Create a file
2. Edit a file
3. Show the content of a file
4. Delete a file
5. Exit
- 1: Create a file: Enter a filename to create a new file.
- 2: Edit a file: Enter the filename and input the content to append. Press Enter on an empty line to finish.
- 3: Show the content of a file: Enter the filename to display its content.
- 4: Delete a file: Enter the filename to delete it.
- 5: Exit: Quit the program.
---------------------------------------------------Keep Notes---------------------------------------------------
Options:
1. Create a file
2. Edit a file
3. Show the content of a file
4. Delete a file
5. Exit
Enter your choice: 1
Enter the name of the file to create: example.txt
File created successfully.
keep_notes.cpp # Main source code file
- createFile(): Handles file creation.
- editFile(): Appends content to existing files.
- showFile(): Displays the content of a file.
- deleteFile(): Deletes a specified file.
- C++ compiler (e.g.,
g++) - Compatible with Windows, macOS, and Linux
To compile and execute the project on different platforms:
g++ keep_notes.cpp -o keep_notes.exe
keep_notes.exeg++ keep_notes.cpp -o keep_notes
./keep_notesThe program includes basic error handling for:
- File creation errors
- File read/write errors
- Invalid file deletion attempts
Contributions are welcome! If you'd like to improve this project, feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Bilal Qadeer (bilalqadeer347@gmail.com)
- Inspired by the need to learn file I/O operations in C++.