A user space shell application that can interpret a FAT32 system image.
To compile you will simply run g++ msh.c -o msh
or gcc msh.c -o msh
- simply type
./msh
to start the program and run the commandopen <filename>
where filename is the FAT32 image
This command shall open a fat32 image. Filenames of fat32 images shall not contain spaces and shall be limited to 100 characters. If the file is not found your program shall output: “Error: File system image not found.”. If a file system is already opened then your program shall output: “Error: File system image already open.”.
This command shall close the fat32 image. If the file system is not currently open your program shall output: “Error: File system not open.” Any command issued after a close, except for open, shall result in “Error: File system image must be opened first.”
This command shall print out information about the file system in both hexadecimal and base 10
This command shall print the attributes and starting cluster number of the file or directory name. If the parameter is a directory name then the size shall be 0. If the file or directory does not exist then your program shall output “Error: File not found”.
This command shall change the current working directory to the given directory. Your program shall support relative paths, e.g cd ../name and absolute paths.
Lists the directory contents. Your program shall support listing “.” and “..” . Your program shall not list deleted files or system volume names.
This command shall retrieve the file from the FAT 32 image and place it in your current working directory. If the file or directory does not exist then your program shall output “Error: File not found”.
Reads from the given file at the position, in bytes, specified by the position parameter and output the number of bytes specified.
Deletes the file from the file system
Un-deletes the file from the file system