Solved

c programing (gcc with cygwin) math to see how many days old a file is

Posted on 2008-09-30
2
384 Views
Last Modified: 2013-11-15
Inside in existing C program running in windows server 2003, I need to do math to find out if a file is the file more than X days old (e.g. more the 3 days old, more than 7 datys old, etc.).  I am using the gcc compiler (ver. 3.4.4) that installs with cygwin.  It apparently does not support __ing64.  The filetime() function says

    "It is not recommended that you add and subtract values from the FILETIME structure to obtain relative  
    times. Instead, you should copy the low- and high-order parts of the file time to a ULARGE_INTEGER
    structure, perform 64-bit arithmetic on the QuadPart member, and copy the LowPart and HighPart
    members into the FILETIME structure."

Is there an easier way to do this, or can someone point me to or provide examples doing the 64-bit math on the quadpart and reading the high and low parts back out?

Thanks,
Leon
0
Comment
Question by:leonvan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 6

Expert Comment

by:RishadanPort
ID: 22609903
Use the stat function, which contains everything about a file, including when it was created. Let me find some information for you.
0
 
LVL 6

Accepted Solution

by:
RishadanPort earned 500 total points
ID: 22609945
Here is a good link about using stat:

http://en.wikipedia.org/wiki/Stat_(Unix)

However, I am not 100 percent certain if this works using windows server, since I have never used this approach on a windows server
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
API v SOA 8 60
What program can open a .sig file image? 6 102
Crashing when deleting value with no child in Binary Tree 4 60
transfer content to new site design 7 44
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
Viewers will learn how to use the Hootsuite Dashboard.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question