Commit 206430b3 authored by Lindsay Knupp's avatar Lindsay Knupp
Browse files

Prelab 10.2 completed

parent 40cbd064
......@@ -32,7 +32,7 @@ int main(int argc, char* argv[]){
size = atoi(argv[3]);
}
fp = fopen(filename, "r+");
fp = fopen(filename, "r");
fseek(fp,offset,SEEK_SET);
for (int i =0; i<size;i++){
......
......@@ -2,9 +2,16 @@ Lindsay Knupp
11/30/21
Lab 10 - prelab.txt
1 1 0 1 0 0 0 0 0
push first three bits to the right hand side, shift by 6 bits
so that it's the only thing in that number
(2.1) The right hand side of the c file displays the text from the file.
1 1 0 & 1 0 0 or 0 1 0 or 0 0 1 to say which permission user has
(2.2) The right hand side of the executable file displays a bunch of periods followed by ./lib64/ld-linux-x86-64.... which is probably the information needed to compile files using linux.
(2.3) The fdump file does not produce something readable because you are trying to view an executable file as a text file which does not make sense. It makes sense for c files since you type text which gets compiled.
(2.4) /usr/bin/file is an ELF 64-bit LSB executable file
~cs315/Labs/Lab10/work is a PDF document, version 1.3
~cs315/Labs/Lab10/beauty is JPEG image
hexdump.o is an ELF 64-bit LSB relocatable
hexdump.h is a C source ASCII text file
Using the man page for file, to my understanding, file passes a variety of arguments to the the test file in order to classify it. The tests examine output from the stat call and they also check if there's any indicator to type of file within the file itself.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment