tags:

views:

509

answers:

3

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?

+8  A: 

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.

Bwooce
+2  A: 

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.

psyeugenic
+1  A: 

Erlware is changing that - in a couple of days the Erlware structures will be exactly that of Erlang OTP. Actually the structure of app packages is already exactly that of OTP and as specified above. What will change is that Erlware installed directory structure will fit exactly over an existing Erlang/OTP install (of course one is not needed to install Erlware though) Erlware can now be used to add packages to an existing install very easily.

Cheers, Martin

I've updated my answer to reflect this positive change. Thanks.
Bwooce