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. Advertising

  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. Advertising

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,270
  2. Dino Buljubasic
    Replies:
    4
    Views:
    18,417
    Roedy Green
    Sep 23, 2005
  3. keithb
    Replies:
    2
    Views:
    7,982
    keithb
    Jun 7, 2006
  4. Ricardo Aráoz

    Re: Read dbf file as read only

    Ricardo Aráoz, Aug 26, 2008, in forum: Python
    Replies:
    0
    Views:
    377
    Ricardo Aráoz
    Aug 26, 2008
  5. geefypants
    Replies:
    0
    Views:
    140
    geefypants
    Oct 28, 2004
Loading...

Share This Page