Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Reading files using C++

  • 12-01-2005 06:48PM
    #1
    Registered Users, Registered Users 2 Posts: 981 ✭✭✭


    Hi all,
    For my project, I need to send robot direction instructions from a mobile phone firslty to the server computer and then onto a robot via a radio packet controller link.
    Currently, I've made the GPRS connection with the server computer and I am writing the Robot direction Instructions, A for Forward, B for Right etc into a file on the C drive using java.
    Does anyone have any ideas how I can instantly read this file using a C++ program to send them to the robot via an RPC interfaced to the computer via the NI-DAQ card. I need to use C++ as it controls the NI-DAQ card.
    Can I write to a file using java and at the same time keep reading the file using C++. I presume I'd need to delete the contents of the file after each robot direction instruction is sent.
    Can anyone please offer any advice on this or maybe suggest a better way of overcoming the situtation
    Thanks and Regards
    Glenman


Comments

  • Hosted Moderators Posts: 7,486 ✭✭✭Red Alert


    I think what you may be looking for is called a Pipe, as it 'pipes' the output from one program into another. It's like a file that never makes it onto a disk. Very easy to do in unix, AFAIK windows is also easy enough. Check a I/O pipes in a textbook.


Advertisement