From: "Thomas B." Date: 2008-10-14T02:47:10+09:00 Subject: Re: Accessing Ruby Object in Memory Bryan Richardson wrote: > Hello all, > > I have a long running Ruby simulation in which data is stored to Ruby > hashes throughout the simulation. I'd like to be able to access the > hashes in memory from another Ruby script while the simulation is still > running to see what the progress of the simulation is (rather than > printing to the screen, using log4r, etc. Is this possible? If so, any > suggestions how to do so? Hello. I guess this is not possible, and even if it is, it is not a good idea to do this. Probably a much better idea would be to start a TCP server in the daemon, and connect to it from the other program, and communicate using some simple protocol. Another idea could be to write some progress info into a file, and open the file from the other process, but then you'll have to handle some concurrency problems (not very hard, I guess, it will be enough to wait a moment and retry on file opening failure). But still I think the server is a better and more standard way to do this. Have a look at TCPServer and TCPSocket in 'socket', it is not hard. TPR. -- Posted via http://www.ruby-forum.com/.