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 / C++ / MFC
  4. Text File Update

Text File Update

Scheduled Pinned Locked Moved C / C++ / MFC
announcement
5 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.
  • G Offline
    G Offline
    gemini65
    wrote on last edited by
    #1

    I have an App. A which is accessing a text file. I have created App. B to update automatically the contents of the text file. But I do not want to exit App. A just to recognize my changes. What should I do to make this possible. The only changes I can do is on App. B, since I have just created that application.:confused:

    N D 2 Replies Last reply
    0
    • G gemini65

      I have an App. A which is accessing a text file. I have created App. B to update automatically the contents of the text file. But I do not want to exit App. A just to recognize my changes. What should I do to make this possible. The only changes I can do is on App. B, since I have just created that application.:confused:

      N Offline
      N Offline
      naren vc
      wrote on last edited by
      #2

      hi u better continuously query for the file size and keep track of the previuos size. if there is mismatch between previous and current file size, it means App A updated the file, then read that file naren

      1 Reply Last reply
      0
      • G gemini65

        I have an App. A which is accessing a text file. I have created App. B to update automatically the contents of the text file. But I do not want to exit App. A just to recognize my changes. What should I do to make this possible. The only changes I can do is on App. B, since I have just created that application.:confused:

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        It sounds like you want FindNextChangeNotification() or ReadDirectoryChangesW(). Yes?


        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        G 1 Reply Last reply
        0
        • D David Crow

          It sounds like you want FindNextChangeNotification() or ReadDirectoryChangesW(). Yes?


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          G Offline
          G Offline
          gemini65
          wrote on last edited by
          #4

          Sorry but that is not how it should work since APP A might be using the file but at the same time APP B will be updating the same text file. I would start APP B anytime to make the necessary changes of the text file.

          D 1 Reply Last reply
          0
          • G gemini65

            Sorry but that is not how it should work since APP A might be using the file but at the same time APP B will be updating the same text file. I would start APP B anytime to make the necessary changes of the text file.

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Either of the two functions that I mentioned can be used by app B to be notified after app A has made changes to some file. Once app B has received notification, it can update the file accordingly. If there is a chance that app A will update the file before app B has finished, I do not know of a solution since you cannot change app A.


            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            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