Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. File reader if something is updated in file
Forum Updated to NodeBB v4.3 + New Features

File reader if something is updated in file

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 982 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.
  • A Offline
    A Offline
    Asad
    wrote on last edited by
    #1

    Dear Friends,
    can someone help me.
    If I am reading xml file and if something is written or edited .then how can i get that node from where the file is updated.I want to escape from that idea so again it will start from beginning to read that file.I want that i should start reading from that node where it is updated or written something in my file.Please give some ideas

    thanks guys

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You need to either remember the line where the tag lies in the file, or store both versions and run diff between them to get the changed lines.

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asad
        wrote on last edited by
        #3

        thanks for replying,
        If I will store both the version then for comparing them we again need to read both the files.so Agin that problem will come .I want to go that line without reading the whole file.
        May be I am not getting something.Can you give some example.or any other idea.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          So use the first option: remember the line. You don't control the IO in the operating system, so you can't "just know" what has been changed.

          And in most cases, reading a file is not a problem: it will take just a few milliseconds. Same with running "diff": it will read both files, true, but it will return all the changes that have been made, and it will do it quickly (git is able to diff between thousands of files in less than a second...).

          (Z(:^

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved