Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Directory Layout for Erlang Services?

Tags:

erlang

In our Java applications we typically use the maven conventions (docs, src/java, test, etc.). For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC.

I'm about to embark on creating a service written in Erlang, what's a good source layout for Erlang applications?

like image 826
Kyle Burton Avatar asked Sep 23 '08 03:09

Kyle Burton


2 Answers

The Erlang recommended standard directory structure can be found here.

In addition you may need a few more directories depending on your project, common ones are (credit to Vance Shipley):

    lib:        OS driver libraries
    bin:        OS executables
    c_src:      C language source files (e.g. for drivers)
    java_src:   Java language source files
    examples:   Example code
    mibs:       SNMP MIBs

Other projects such as Mochiweb have their own structures, Mochiweb even have a script to create it all for you. Other projects such as Erlware overlay on the standard structure.

like image 163
Bwooce Avatar answered Oct 03 '22 14:10

Bwooce


Another critical directory is the priv directory. Here you can store files that can easily be found from your applications.

code:priv_dir(Name) -> string() | {error, bad_name}

where Name is the name of your application.

like image 31
psyeugenic Avatar answered Oct 03 '22 16:10

psyeugenic