Project 3: File System Decoder
- Open the image file in binary mode.
For example, when using fopen() in C/C++, use mode "rb". If using ifstream class in C++, make sure to use ios::binary mode.
NOTE: Since you are required to read the image file from stdin, use read() should be enough without opening the stdin.
- Forget about page-in/out, read the whole file into memory first!
- File analysis:
- Once a file is found, use sscanf() to read first 3 string
- Check if return value of sscanf() is 3
- Check the date format
- If all pass, read the rest of data until '#'
- Read the string '#'
- Read the string after '#' and convert it into int.