Read only access on an already open file

E

elitecodex

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!
 
V

Victor Bazarov

elitecodex said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top