Thread: Last modified date?

  1. #1
    Registered User Hoxu's Avatar
    Join Date
    Nov 2001
    Posts
    25

    Unhappy Last modified date?

    I'd be pleased to know how I can get the "last modified" -date&time from a file... the code should be linux compatible.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Use the stat() function in sys/stat.h
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Hoxu's Avatar
    Join Date
    Nov 2001
    Posts
    25

    Smile

    ok, thanks. Just got a bit confused about Borland C++ compiler help.. it claimed that ctime, mtime and atime were the same

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > it claimed that ctime, mtime and atime were the same
    They are in DOS, cos it's a lame OS on an even lamer file system

    If you want differences, then you need an NTFS partition and an NT type OS.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advancing day by day until it matches a second date
    By nhubred in forum C++ Programming
    Replies: 1
    Last Post: 05-30-2009, 08:55 AM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  3. Date Last Modified
    By magic.mike in forum Windows Programming
    Replies: 5
    Last Post: 09-23-2005, 05:13 AM
  4. CDate Class - handle date manipulation simply
    By LuckY in forum C++ Programming
    Replies: 5
    Last Post: 07-16-2003, 08:35 AM