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
  1. Home
  2. General Programming
  3. C#
  4. File Creation Time

File Creation Time

Scheduled Pinned Locked Moved C#
architecturehelpquestion
3 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.
  • T Offline
    T Offline
    telha
    wrote on last edited by
    #1

    I have situation in code where I have to deal with the File Creation Time. I have used System.IO.File class to check for the existence of the File and then deleted it, then in another function created the File using FileStream Class with FileMode.Create and CreateNew Parameter. File is delete in both cases from disk, (as it shows in the folder - with FileInfo and System.IO.File) but when the File is created again with FileMode.Create and FileMode.CreateNew, it has the older creation date i.e. the date of the deleted file. Can anyone help on this with a thorough and solid answer?

    Muhammad Talha

    A R 2 Replies Last reply
    0
    • T telha

      I have situation in code where I have to deal with the File Creation Time. I have used System.IO.File class to check for the existence of the File and then deleted it, then in another function created the File using FileStream Class with FileMode.Create and CreateNew Parameter. File is delete in both cases from disk, (as it shows in the folder - with FileInfo and System.IO.File) but when the File is created again with FileMode.Create and FileMode.CreateNew, it has the older creation date i.e. the date of the deleted file. Can anyone help on this with a thorough and solid answer?

      Muhammad Talha

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      Well, it seems strange that it would keep the old date/time but i'm sure there's a reason. Until you find out why, you can set the creation time yourself. Sadly, i can't remember where exactly you do that, you may need to do a bit of googling.

      My current favourite word is: Waffle Cheese is still good though.

      1 Reply Last reply
      0
      • T telha

        I have situation in code where I have to deal with the File Creation Time. I have used System.IO.File class to check for the existence of the File and then deleted it, then in another function created the File using FileStream Class with FileMode.Create and CreateNew Parameter. File is delete in both cases from disk, (as it shows in the folder - with FileInfo and System.IO.File) but when the File is created again with FileMode.Create and FileMode.CreateNew, it has the older creation date i.e. the date of the deleted file. Can anyone help on this with a thorough and solid answer?

        Muhammad Talha

        R Offline
        R Offline
        Rob Philpott
        wrote on last edited by
        #3

        Take a look at this: http://www.devcity.net/Articles/133/1/article.aspx[^]

        Regards, Rob Philpott.

        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