Re: Multiple processes and tie'd files



On Aug 30, 10:20 pm, xhos...@xxxxxxxxx wrote:
Tuc <tuct...@xxxxxxxxx> wrote:
When I tie to a DB_File, if one of the processes or even an
external process updates the file, the persistent processes aren't
seeing the update. I have to stop them and restart them for that to
happen.

Have you read the documentation for DB_File?

I did, way back. Then 10 minutes after I posted I read it again
and found the section that said "Hey, Tuc, you can't do that with
DB_File".

Sorta defeats the whole reason for using a tie'd file, I could
just put it into a hash.

If that is the "whole" reason you are using DB_File, then you shouldn't
be using DB_File in the first place.

What should I be using then? I need something that I can ask it
by a key, and get data back. It needs to be accessible from multiple
programs, and easily updated without modifying the program. I need it
to be fast/lightweight/not require any additional processes running.


I've tried using the "sync" method on the handle for the tie,
before and after every read, still with no luck.

sync syncs up memory changes to the disk. I don't think it is supposed to
sync disk changes back to memory.

Had hoped.


Short of going to mysql (Which is like trying to swat a fly with
the supercollider) is there another option?

Mysql is not a super-collider, it is a very light-weight fly swatter. What
you are trying to doing with DB_File is like trying to swat a fly with a
pencil sharpener.

Doesn't make sense to start an instance of Mysql for a table
that will probably be 75-100 entries.

So what do you suggest to be able to do this? Just "open, while,
close" a text file?

I was also trying to keep with DB_File since another program
actually was generating it, DB_File the only available format. I might
be able to (and it looks like might have to, unless I want to keep 2
copies) remove the usage of the file from the other program.

Tuc
.