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. Write to a fiel and read the same fiel in real time.

Write to a fiel and read the same fiel in real time.

Scheduled Pinned Locked Moved C / C++ / MFC
help
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.
  • A Offline
    A Offline
    amitranjanmishra
    wrote on last edited by
    #1

    HI , I wanna help on a simple application. I have 2 applications in c language. First application 'A' has some data being written in a text file 'T'. Second Application 'B' simultaneously is reading that data from the same file 'T'(if any) and producing the desired output. Can it b done n how. amit mishra

    T R 2 Replies Last reply
    0
    • A amitranjanmishra

      HI , I wanna help on a simple application. I have 2 applications in c language. First application 'A' has some data being written in a text file 'T'. Second Application 'B' simultaneously is reading that data from the same file 'T'(if any) and producing the desired output. Can it b done n how. amit mishra

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      set a flag in the registry (or in a temporary text file). this way, by testing the flag before writing or reading, you could know if you are allowed to (or not)...

      prog1 :
      if (**!**flag) {
      int fd = fopen("T");
      fprintf("some datas to write");
      fclose(fd);
      flag = true;
      }

      prog2 :
      if (flag) {
      int fd = fopen("T");
      char strTab[100];
      fscanf("%s", strTab[0]);
      fclose(fd);
      flag = false;
      }


      TOXCCT >>> GEII power
      [VisualCalc]

      1 Reply Last reply
      0
      • A amitranjanmishra

        HI , I wanna help on a simple application. I have 2 applications in c language. First application 'A' has some data being written in a text file 'T'. Second Application 'B' simultaneously is reading that data from the same file 'T'(if any) and producing the desired output. Can it b done n how. amit mishra

        R Offline
        R Offline
        Robert Bielik
        wrote on last edited by
        #3

        What you should do is lookup "Named Pipes". This is in essence exactly what you want to do. Do a search on SS_Log on Codeproject and you'll find the SS_Log_Server article that does exactly that.

        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