System V MessageQueue

Hello Friends,

I have been trying to communicate with System V message queue inside
ruby script. I found a module on the web which allows me to do so.
http://rubyforge.org/projects/sysvipc/

But, I have been facing problem connecting to a queue using above API.
Can somebody help me out here ?

----------------Code-------------------------------------------------
1
2 require ‘sysvipc’
3 include SystemVIPC
4
5 key = ftok(“/home/sameer/mq”, 66)
6
7 msq = MessageQueue.new(key,0644)
8
9 msq.send(1,“message”)
10
11 p= msq.recv(1,12)
12
13 print p
14
15
~

Thanks.

Best regards,
Sameer.

Hi,

2009/6/21 Sameer T. [email protected]:

 1
 12
 13 print p
 14
 15
~

The line 7
msq = MessageQueue.new(key,0644)
should be
msq = MessageQueue.new(key,0644 | IPC_CREAT)

Regards,

Park H.