Thread: File Properties?

  1. #1
    Registered User
    Join Date
    Nov 2002

    Question File Properties?

    How can i obtain the creation date of any given file? I expect theres a library function somewhere.

    Simple to say but cant find any reference to it in my books.

    Thanks for any help peeps

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    What OS / Compiler ?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    The standard doesnt define functions to do this.

    If you want this info, then you need an API for your specific OS..

    If you are looking at windows, go to MSDN and look at GetFileAttributesEx()

  4. #4
    Registered User
    Join Date
    Aug 2002

    Probably it's not what you're looking for, but it could be useful.
    Under a GNU-compatible system, check out struct stat and the function stat. The struct contains many attributes, inlcuding but not limited to - last access and last mod. timestamps.

    Also, there is a great func in Borland C++ Builder 6. This is called FileGetAttr. The struct which holds the desired info is TSearchRec. You'll need Windows to use this.

    Hope this helps!

    Good luck!
    Best Regards,


  5. #5
    Registered User
    Join Date
    Nov 2002

    OS / Compiler i'm using

    Thanks for the replys

    I'm using DOS versions 4.08, 5.09 & 5.10 and VC++ 1.52 compiler.

  6. #6
    Registered User
    Join Date
    Nov 2002

    Thumbs up job done

    Thanks all,

    ended up using the dos.h header,

    and functions _dos_findfirst , _dos_findnext

    if anyone else is interested

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. multiple file loading. so fruturated! help!
    By psychopath in forum Game Programming
    Replies: 5
    Last Post: 05-09-2005, 05:13 PM
  4. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM