Your cart is currently empty!
Instructions Answer the questions individually. Group effort is not allowed. Solutions must be committed to your respective repositories on github. For this assignment, you are not allowed to use any library functions other than printf. Ensure that your code runs on remote.cs.binghamton.edu. Prototypes must be provided for all functions within…
Instructions
– Common linux commands: http://www.informit.com/blogs/
blog.aspx?uk=The-10-Most-Important-Linux-Commands
Questions
1
Table 1: Signature to type mapping. All signatures start from the beginning of the file. This is only a sample for the assignment. For curious minds, more can be found here: https://en.wikipedia.org/wiki/List of file signatures
Signature (first few bytes in Hex) File type Expected output
47 49 46 38 39 61 or 47 49 46 38 37 61 GIF Image This is a GIF file.
7f 45 4C 46 ELF file This is an ELF file.
25 50 44 46 PDF file This is a PDF file.
50 4B ZIP file This is a ZIP file.
CA FE BA BE Java class file This is a Java class file.
89 50 4E 47 0D 0A 1A 0A PNG file This is a PNG file.
Anything else Unknown file File type unknown.
format of the file and the program that can open it. NOTE: Although file exten- sions can sometimes tell what format a file is, it is an unreliable indicator. The file signature is the true indicator of a file type.
Useful resources
Testing your code
In order to test your code, we will run the make command to generate the program. We will then call the program in a loop on a set of known file types, and in each case, we will check if the output is as expected in Table 1. We will also provide invalid number of arguments and non-existent files as arguments. NOTE: The testing process may be automated. It is your responsibility to ensure that the files are named correctly. You are advised to test the programs before submitting. Each valid input file is guaranteed to be at least 10 bytes in size.