Files are the fundamental abstraction of storage media. User data is stored in files on disks- so files must support reading and writing data, as well as facilitating the storage and location of data on disk when it is needed.
In this studio, you will:
Please complete the required exercises below, as well as any optional enrichment exercises that you wish to complete.
As you work through these exercises, please record your answers in a text file. When finished, submit your work by sending your text file and source code to dferry@slu.edu with the phrase Files in the subject line.
Make sure that the name of each person who worked on these exercises is listed in the first answer, and make sure you number each of your responses so it is easy to match your responses with each exercise.
touch
command:
touch test.txt
Use the command "ls -l
" to list all of the files in the current
directory. What are the permissions on your new file?
xxd
program
to display the individual bytes of your file. Copy and paste
the results.
xxd
to
look at the byte-level data of these files as well. Print their contents to
your console- what are the first four bytes (eight hex digits) of each file?
xxd
is neat, but not very useful for analyzing
executable files. Fortunately, there is a special program designed to do just
that. Find an executable file and call it with the program readelf
:
readelf -h your_program
This prints some basic information about your program. Pick out and explain two lines of this output.
main
function reside? Hint- look at the symbol table.