Questions tagged [erl]

The erl program is Erlang Emulator, starting an Erlang runtime system.

The executable script erl is a front-end to the Erlang runtime system. Windows users probably wants to use the werl program instead, which runs in its own window with scrollbars and supports command-line editing.

160 questions
1
vote
1 answer

Erlang heartbeats

I am trying to create an application that can run on two different machines on the same network, and when one of the applications crahes, I want to use erlang heartbeat system to make it restart. How can I do this? I've read the documentation, but…
kristian X
  • 21
  • 1
1
vote
2 answers

Erlang {badrpc,nodedown} error while making rpc:call

I have two nodes with different cookies. I am trying to make a call, as written below, but i am getting {badrpc,nodedown} everytime. onenode@localhost>rpc:call(othernode@localhost,erlang,system_info,[otp_release]). I have tried finding on google…
Madhusudan Joshi
  • 4,438
  • 3
  • 26
  • 42
1
vote
0 answers

Why filelib:is_file() always returns false in ejabberd module?

I wrote a module for ejabberd, in the module i checked existence of an image file. i used filelib:is_file() for that purpose. when existence of image file checked in ejabberd module it always return false, but when i compile and run by erl program,…
Saeed
  • 572
  • 2
  • 7
  • 19
1
vote
2 answers

Erlang VM -s Argument is causing my program to fail

I have read the thread here: Erlang VM -s argument misbehaving and have been troubleshooting to no avail. When I run the erlang vm without the -s flag, my function works: bridge_sup:start_link(). Bridge Supervisor Initializing [warning]…
Code Wiget
  • 1,540
  • 1
  • 23
  • 35
1
vote
2 answers

Erlang newbie - concurrency and message passing

I'm still new to programming and brand new erlang (2 week newbie!). I edited slightly so atleast it'll compile and run. But I still can't figure out the concept of sending the results to a "joiner process" to join all the seperate results. It does…
chitown88
  • 27,527
  • 4
  • 30
  • 59
1
vote
1 answer

Erlang - serialize a string (with no newlines/carriage returns)?

I've seen some answers to this in other programming languages, but not a specific erlang one. I'm able to read the file and I use: re:replace(Subject, RE, Replacement, Options) specifically: re:replace(Content, "\r" , "…
chitown88
  • 27,527
  • 4
  • 30
  • 59
1
vote
0 answers

Getting Room Name or Subject From Muc Hooks

I want to get the room's name or subject from one of the ejabberd hooks. I've a method like in the below code and I want to get room's name or subject within that method. Is something like that possible? muc_filter_message(Stanza, MUCState, RoomJID,…
tolgatanriverdi
  • 561
  • 9
  • 31
1
vote
1 answer

rabbitmq-server installation CentOS - Erlang Error

I have centos 6 and trying to install rabbitmq 3.5.3 using rpm. (do not have option for yum) its throwing me below eror. [root@osboxes CentOS]# rpm -Uvh rabbitmq-server-3.5.3-1.noarch.rpm warning: rabbitmq-server-3.5.3-1.noarch.rpm: Header V4…
Vishwa
  • 607
  • 2
  • 11
  • 21
1
vote
0 answers

Return an array from PHP to erlang

I'm trying to return an array of two values from PHP to erlang. I'm making a http call from erlang to a web server using http:request. The web server is returning the array as $args = array($p1, $p2); return $args; On Erlang side I receive as …
sad
  • 820
  • 1
  • 9
  • 16
1
vote
1 answer

Passing -eval for Erlang erl from bash variable fails

I am trying to start erl from bash script. When I pass the eval expression content from a variable erl fails to start. When eval option is directly given in erl command line, erl starts without any issues. How to do correct ? #!/bin/bash…
DevMinz
  • 23
  • 3
1
vote
1 answer

How do I prevent message flooding with open_port?

I'm trying to read a 100gb file through stdin one line at a time using Port = open_port({fd, 0, 1}, [in, binary, {line, 4096}]), but this floods my system with messages until I run out of ram. Is there a away to make it like {active, once} with…
ForeverConfused
  • 1,607
  • 3
  • 26
  • 41
1
vote
1 answer

ejabberd: get users (version & os) when connect to the server

I'm trying to read users os "Windows XP, Windows 7, Linux .... etc" when they connected I'm working on ejabberd 2.1.x but nothing shown to me. What I'm doing is : -module(mod_test). -behaviour(gen_mod). %% gen_mod callbacks -export([start/2,…
Mr. zero
  • 245
  • 4
  • 18
1
vote
1 answer

ERL: execute erl command from shell

so here is what I want - to execute the following mini script from bash shell: mnesia:change_table_copy_type(schema, node(), disc_copies). I am trying to find out the possibilities but can not find a clear answer. There is a "-noshell" option, or,…
Peter
  • 171
  • 2
  • 12
1
vote
2 answers

ejabberd : How to extract data from xml element

I have this packet : {xmlelement,"presence", [{"xml:lang","en"}, {"ver","6.00.00"}, {"to", "test@conference.localhost/user"}], [{xmlelement,"c", [{"xmlns", "http://jabber.org/protocol/caps"}, {"node",…
Mr. zero
  • 245
  • 4
  • 18
1
vote
2 answers

Erlang: read ip address

I'm trying to get my IP address using Erlang. I found this example from here: Erlang: Finding my IP Address local_ip_v4() -> {ok, Addrs} = inet:getifaddrs(), hd([Addr || {_, Opts} <- Addrs, {addr, Addr} <- Opts, size(Addr) == 4, Addr =/=…
Mr. zero
  • 245
  • 4
  • 18