This project is a console application designed for managing directories and .txt files. It provides functionalities such as browsing directories, displaying directory trees, creating, modifying, reading, and deleting files.
- Change Directory: Navigate between directories.
- List Files: Display files and directories in the current path.
- Display Directory Tree: Show directory structures with indentation.
- Calculate Directory Size: Compute the total size of files in a directory.
- Create File: Create new
.txtfiles and open them in the default editor (Windows only). - Read File: Read the content of a
.txtfile. - Write File: Append content to a
.txtfile. - Delete File: Delete a
.txtfile after user confirmation. - Open in Editor: Open a
.txtfile in the default editor (Windows only).
DirectoryManager.hpp/cpp: Handles directory-related operations.FileManager.hpp/cpp: Handles file-related operations.main.cpp: Entry point of the application and implements the user interface.
The application features a console-based menu with the following options:
- a: Display the current directory.
- c: Change the current directory.
- n: Create a new
.txtfile. - l: List files in the current directory.
- t: Display the directory tree.
- r: Read the content of a
.txtfile. - m: Append content to a
.txtfile. - d: Delete a
.txtfile. - q: Exit the application.
-
Creating a File:
- Select option
n. - Enter the file name with the
.txtextension. - The file will open in the default editor (Windows only).
- Select option
-
Displaying a Directory Tree:
- Select option
tto view the directory structure with indentations.
- Select option
-
Reading a File:
- Select option
rand provide the file name to read its contents.
- Select option
- File opening in the default editor (
openInEditormethod) is available only on Windows. On other systems, this functionality is ignored.
- A compiler supporting C++20 standard.
g++ -std=c++20 main.cpp file.cpp directory.cpp -o fileman./fileman- Oskar Kierys