- Open the terminal from the folder where
main.cpp
exists - Run the below command to compile the program
g++ main.cpp
- Run the following command to execute the executable file
./a.out
- Enter the name of the disk
- Creates a disk of 500 MB
- Enter the name of the disk
- Reads the file's and disk's metadata to memory from disk
- Exits the program
- Enter the name of the file
- Enter the name of the file and mode in which to open 0 - Read mode 1 - Write mode 2 - Append mode
- Returns a file descriptor
- Enter the file descriptor returned by Open file command
- Make sure you opened the file in Read mode
- Enter the file descriptor returned by Open file command
- Make sure you opened the file in Write mode
- Enter the contents of the file
- Press
CTRL + D
to stop writing and save file.
- Enter the file descriptor returned by Open file command
- Make sure you opened the file in Append mode
- Enter the contents of the file
- Press
CTRL + D
to stop writing and save file.
- Enter the file descriptor returned by Open file command
- Enter the file name
- Make sure you have closed the file
- Return the list of files
- Return the list of opened files
- Writes the file's and disk's metadata back to disk