Nasm Assembly Programming Assignment 6
Goal: File properties program
Step 1. Creating the assembly language file
Everything should be done the same way as the previous assignment.
Step 2. The application area
This assignment will give practice at using a struct and working with C library
The goal is very simple. Your program should take a file name and print the time
since the file was last modified.
We have already discussed in class how to find out the current time.
The tool you need to determine when a file was last modified is stat() or fstat().
These will return a lot of information about a file. You can ignore almost all of this
information except for the time modified.
Additional discussion: https://stackoverflow.com/questions/11765683/how-toread-
Note that stat can be used from the command line as well (see
http://labtestproject.com/linuxcmd/stat.html) but we want to call it as a function.
Discussion of the difference between timeval and timespec:
Aside: ISO 8601 date format: https://askubuntu.com/questions/355188/dateformat-
Step 3. What your code should do
1. Your code should use STDIN and STDOUT for input and output. (This is the
default.) Use redirection on the command line to read from a file and write to a
file. Or you can take the file name from the command line as I did with the
Cryptoquip helper example I went over in class.
2. Your code should take a file name as input.
3. The code should output the length of time since the file was last modified. The
format is days, hours, minutes and seconds.
4. The program should call stat() or similar function to get the modification
time of the file in question.
5. This program should use glibc functions for input and output..
Step 4. Turning in the assignment
Turn in the following:
1. Commented listing file.
2. Demonstration of functioning for several different files that were modified
several days previously.
3. Include command line output of ls -l for the files so we can verify the
Recently Asked Questions
- Please need help show clear explanation please thank you.... Use the Internet to search for relevant information to prepare a brief report on how SAP and
- 1.Please explain what deductive logic is. In discussing deductive logic, explain the two levels of evaluation that are used. Please provide an example of a
- Some organizations group activities into four cost categories, called the hierarchy of costs, to help managers form cost pools for activity-based costing