Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. _stat function and files before 1970

_stat function and files before 1970

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vikramlinux
    wrote on last edited by
    #1

    Hi All, I am trying to use _stat C runtime method for a file with time stamp before 1970. It simply crashes.Anybody knows the reason? Note: My time zone is GMT-5.00 (Eastern time [us+Canada]). - Vikram S

    M S 2 Replies Last reply
    0
    • V vikramlinux

      Hi All, I am trying to use _stat C runtime method for a file with time stamp before 1970. It simply crashes.Anybody knows the reason? Note: My time zone is GMT-5.00 (Eastern time [us+Canada]). - Vikram S

      M Offline
      M Offline
      Michael Schubert
      wrote on last edited by
      #2

      _stat uses time which states in the documentation: The time function returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970

      1 Reply Last reply
      0
      • V vikramlinux

        Hi All, I am trying to use _stat C runtime method for a file with time stamp before 1970. It simply crashes.Anybody knows the reason? Note: My time zone is GMT-5.00 (Eastern time [us+Canada]). - Vikram S

        S Offline
        S Offline
        Stuart Dootson
        wrote on last edited by
        #3

        As far as C is concerned, time (== time_t) started on 1st January 1970[^] - your file with an earlier timestamp is obviously blowing the C runtime's mind. It's like saying to a physicist "here's a file from 10 minutes before the universe existed" - does not compute!

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        V 1 Reply Last reply
        0
        • S Stuart Dootson

          As far as C is concerned, time (== time_t) started on 1st January 1970[^] - your file with an earlier timestamp is obviously blowing the C runtime's mind. It's like saying to a physicist "here's a file from 10 minutes before the universe existed" - does not compute!

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          V Offline
          V Offline
          vikramlinux
          wrote on last edited by
          #4

          So what method I should use for stat? - Vikram S

          S 1 Reply Last reply
          0
          • V vikramlinux

            So what method I should use for stat? - Vikram S

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #5

            I have to ask one question - are file date-times before 1970 actually meaningful? They obviously aren't proper create/modification dates, so why do you need to manipulate them?

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            V 1 Reply Last reply
            0
            • S Stuart Dootson

              I have to ask one question - are file date-times before 1970 actually meaningful? They obviously aren't proper create/modification dates, so why do you need to manipulate them?

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              V Offline
              V Offline
              vikramlinux
              wrote on last edited by
              #6

              My customer has this kind of data files!

              S 1 Reply Last reply
              0
              • V vikramlinux

                My customer has this kind of data files!

                S Offline
                S Offline
                Stuart Dootson
                wrote on last edited by
                #7

                With creation and/or modification dates prior to 1970? Really. OK - what do you need from the _stat function? You should be able to use Win32 functions to determine the values of file attributes that _stat gives you.

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups