Read only access on an already open file

Discussion in 'C++' started by elitecodex, Nov 4, 2005.

  1. elitecodex

    elitecodex Guest

    Hello everyone.

    I want to know the best way to accomplish this particular situation.

    I have a C++ application that has a file open for write access
    constantly and it is always updating the information in the file (
    maybe once a second or so ). That isnt the problem :)

    I want to have a second seperate application (written in PHP or Java,
    but thats irrelavent) that _only_ reads the information in the file.
    So it will open it for read access only, read it in, and close it.

    I know that things don't really work well when files already have open
    handles on them, so i was wondering what the input was regarding this.
    Im sure this has to be done somewhere as I dont think its revolutionary
    :) Just escapes me as to what to do.

    Thanks everyone!
     
    elitecodex, Nov 4, 2005
    #1
    1. Advertisements

  2. elitecodex wrote:
    > I want to know the best way to accomplish this particular situation.
    >
    > I have a C++ application that has a file open for write access
    > constantly and it is always updating the information in the file (
    > maybe once a second or so ). That isnt the problem :)


    OK

    > I want to have a second seperate application (written in PHP or Java,
    > but thats irrelavent)


    Relevant enough to make your question OT...

    > that _only_ reads the information in the file.
    > So it will open it for read access only, read it in, and close it.
    >
    > I know that things don't really work well when files already have open
    > handles on them, so i was wondering what the input was regarding this.


    Post to the newsgroup that deals with your OS. File access across
    processes, locking, rights, exclusiveness, etc., are all features of your
    OS, not of the language.

    > Im sure this has to be done somewhere as I dont think its revolutionary
    > :) Just escapes me as to what to do.


    That's simple: find a better place to ask your OS-specific question.

    V
     
    Victor Bazarov, Nov 4, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TC
    Replies:
    3
    Views:
    3,512
  2. keithb
    Replies:
    2
    Views:
    8,375
    keithb
    Jun 7, 2006
  3. Sara Khalatbari
    Replies:
    6
    Views:
    445
    Jeff Shannon
    Mar 16, 2005
  4. Mel

    Open Excel file as read only

    Mel, Nov 14, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    3,078
  5. Darin Duphorn
    Replies:
    4
    Views:
    197
    Darin Duphorn
    Feb 4, 2008
  6. Alex Dowad
    Replies:
    4
    Views:
    675
    Michel Demazure
    May 1, 2010
  7. Matt

    open file read-only

    Matt, Apr 2, 2004, in forum: Javascript
    Replies:
    1
    Views:
    182
    Hywel
    Apr 2, 2004
  8. geefypants
    Replies:
    0
    Views:
    291
    geefypants
    Oct 28, 2004
Loading...