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. Visual Basic
  4. folder updated time

folder updated time

Scheduled Pinned Locked Moved Visual Basic
databasesql-serversysadminhelpannouncement
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.
  • J Offline
    J Offline
    jishbalan
    wrote on last edited by
    #1

    Hello friends, I am using VB Appliction(let it be X) to load the txt files to SQL server. The application is taking the files from a shared folder. Some other tool(Y) is creating these txt files and placing them in the shared folder. By chance, a situation happend if both application is running simultaneously. Then my application may getting a chance of loading half created files(creating by Y) to the server. I dont want to load such files.Want to load it to the server by next time,by that time the files will be fully generated by y. What i want is want to check last folder update time. If the folder is recently updated(means some files recently added) then dont want to run my application. So please help me to get the last folder update time. So i can compare it with system time and can decide, whether i want to run my application Thanks and regards Jishtih

    D A 2 Replies Last reply
    0
    • J jishbalan

      Hello friends, I am using VB Appliction(let it be X) to load the txt files to SQL server. The application is taking the files from a shared folder. Some other tool(Y) is creating these txt files and placing them in the shared folder. By chance, a situation happend if both application is running simultaneously. Then my application may getting a chance of loading half created files(creating by Y) to the server. I dont want to load such files.Want to load it to the server by next time,by that time the files will be fully generated by y. What i want is want to check last folder update time. If the folder is recently updated(means some files recently added) then dont want to run my application. So please help me to get the last folder update time. So i can compare it with system time and can decide, whether i want to run my application Thanks and regards Jishtih

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      What you're asking isn't really reliable. The folder will not change it's Last Modified Time upon a write of a file inside it. It will only do this upon the creation or delete of a file. You should be inventorying the files in that folder, checking the time the files was created, then giving an appropriate amount of time for the other process to complete before opening those files and processing them.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      1 Reply Last reply
      0
      • J jishbalan

        Hello friends, I am using VB Appliction(let it be X) to load the txt files to SQL server. The application is taking the files from a shared folder. Some other tool(Y) is creating these txt files and placing them in the shared folder. By chance, a situation happend if both application is running simultaneously. Then my application may getting a chance of loading half created files(creating by Y) to the server. I dont want to load such files.Want to load it to the server by next time,by that time the files will be fully generated by y. What i want is want to check last folder update time. If the folder is recently updated(means some files recently added) then dont want to run my application. So please help me to get the last folder update time. So i can compare it with system time and can decide, whether i want to run my application Thanks and regards Jishtih

        A Offline
        A Offline
        Alan N
        wrote on last edited by
        #3

        Hi, If you are going to write any code that manipulates files or folders then you need to become familiar with the classes in the System.IO namespace. There aren't many and it won't take you long to browse through the documentation and get an idea of what they do. In answer to your specific question about folder update time take at look at either System.IO.Directory or System.IO.DirectoryInfo and you will find the answer. Alan.

        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