Q:

file modification time as integer in C

I have seen and tried different ways in displaying the time a file was last modified and I'm using the C programming language.
What I want to achieve is the least CPU intensive function to determine the time a given file is modified, but instead of displaying it as a string or displaying parts of the string, I want to store it as a large integer so I can do math on it later. 
So basically I want to mimic the operation of PHP's filemtime but in C since I'm writing an apache module.
Any ideas how to go about this or ideas on what good functions to use to achieve this without making something super lengthy?

A:

You could declare a stat struct and use stat( ) to get the file details in the stat structure defined. 
Example Code:
#include <time.h>
#include <sys/stat.h>
#include <stdio.h>
int main()
{
  struct stat file_details;
  stat("homework.txt", &file_details);
  time_t modify_time = file_details.st_mtime; 
  printf("Last modified : %lld",modify_time);
  return 0;
}

I don't know how you would manage math on it, but here's your modify_time in a time_t {aka long int}.

