| Author |
Message |
< Erlang ~ Some basic questions (files, packages) |
| drakon |
Posted: Fri Sep 18, 2009 9:48 pm |
|
|
|
Joined: 18 Sep 2009
Posts: 5
|
Hi
I'm wondering how I can place my source files in an other folder. For example in a sub folder.
And an other problem ist, thaht when i start erlang directly in the folder i can compile the .erl files but if I start erlang with a link i can't. I do not really understand why erlang does that.
And one final question. Or it's more a confusion. I realised that the actual reference here:
file:///C:/Programme/erl5.7.2/doc/index.html
does not contain anything about packages:
http://www.erlang.se/publications/packages.html
which I found while trying to solve the first problem. Why isn't it includede anymore?
I use erts-5.7.2 on Windows XP.
Thanks for help |
|
|
| Back to top |
|
| uwiger |
Posted: Sat Sep 19, 2009 1:23 pm |
|
|
|
User
Joined: 03 Jul 2006
Posts: 604
Location: Sweden
|
drakon wrote: I'm wondering how I can place my source files in an other folder. For example in a sub folder.
You can. Erlang doesn't care where the source is, but some build tools may. In these cases, you need to provide them with the information needed to find the source files as well as the build target directory. If you describe what problems you encounter, it will be easier to help.
drakon wrote: And an other problem ist, thaht when i start erlang directly in the folder i can compile the .erl files but if I start erlang with a link i can't. I do not really understand why erlang does that.
It isn't Erlang, but Windows that sets the current working directory. You can change it by right-clicking on the link and selecting 'Properties'. In Vista, it's the 'Start in:' option. I don't recall what it is in XP, but it was fairly intuitive.
It never has been part of the official documentation. It is an experimental and unsupported feature.
BR,
Ulf W |
|
|
| Back to top |
|
| drakon |
Posted: Sat Sep 19, 2009 2:00 pm |
|
|
|
Joined: 18 Sep 2009
Posts: 5
|
Yeah. I wasn't precise yesterday. Sorry.
I'am using the Erlang Shell to compile and there I don't know how to specify the search paths.
I expected that it's possible to specify the path like that:
to compile in an other folder. It would be also nice to specify it non-realtive.
But am I right that's that impossible and I have to specify a some kind of path?
Is there a common IDE for erlang projects? Something like Visual Studio or Eclipse?
EDIT:
OK, i found e plug in for Eclipse. However, which tools do you/others use for developing erlang?
EDIT2:
Hmm. It seems to me very confusing that its not easy to build a "user-friendly" application.. I come from C++, where you naturally generate an .exe and which is basically independent of other things (well it's linking dependent, but that's not really a problem). I searched a way to build up a .exe in erlang and found this:
http://www.sics.se/~joe/sae.html
But the Windows way seems not to work. So my additional question is: How can i build up an hello-world application (.exe) which I can copy on an other computer where no erlang is installed and just use the application? |
|
|
| Back to top |
|
| Mazen |
Posted: Sun Sep 27, 2009 8:31 am |
|
|
|
User
Joined: 20 Jul 2006
Posts: 164
Location: London
|
drakon wrote: So my additional question is: How can i build up an hello-world application (.exe) which I can copy on an other computer where no erlang is installed and just use the application?
You can't [currently, or perhaps never will be able to... probably]. |
|
|
| Back to top |
|
| drakon |
Posted: Sun Sep 27, 2009 1:56 pm |
|
|
|
Joined: 18 Sep 2009
Posts: 5
|
hmm. That sounds bad to me. But actually i've seen a webpage, where it was explained how to create e executable but IIRC it was just for linux and the windows version was not working..
anyway. so is it intendet to use an erlang program from this console and call the functions? - is this the normal way to use an erlang program? - i'm a little bit confuesed about that because i'm used to "normal" executables where you can create programs which are friendly for "not-programmers" which seems erlang not to be.. |
|
|
| Back to top |
|
| Mazen |
Posted: Mon Sep 28, 2009 6:22 am |
|
|
|
User
Joined: 20 Jul 2006
Posts: 164
Location: London
|
Could you please be more specific on how you expect your application to be used? Will it be used from the command prompt? Will you click on a shortcut on the desktop? How would you see it working?
Also, what kind of application is it? Is it a GUI application or console application?
/Mazen |
|
|
| Back to top |
|
| drakon |
Posted: Mon Sep 28, 2009 8:13 am |
|
|
|
Joined: 18 Sep 2009
Posts: 5
|
Well at start nothing really special just for exame a simple chat program. a user should just have an .exe start it (just an console app) and maybe have to connect with an other client or so. the program should than read the input and send it to the spicified other client. it shouldnt be possible to call functions like that way you do with the erlang console.
so it shouldnt be interactive where you can do other things as the things intented from the programmer.
hope this is specific enough.  |
|
|
| Back to top |
|
| Mazen |
Posted: Mon Sep 28, 2009 8:57 am |
|
|
|
User
Joined: 20 Jul 2006
Posts: 164
Location: London
|
I don't know if you are familiar with how Java does it but you should think of it the same way with Erlang.
You have the virtual machine which you start with erl. erl takes a bunch of parameters and runs in the console. You can remove the shell from erl so that it doesn't allow arbitrary input (only input when you ask for it).
E.g:
Code:
C:\Users\mazen>erl -noinput -noshell -run io format "Hello World" -eval halt()
Hello World
C:\Users\mazen>
I suggest you first look at:
http://www.erlang.org/doc/man/erl.html
and
http://www.erlang.org/doc/man/init.html
then you look at the following flags on those pages (which might interest you):
-detached
-noshell
-noinput
-boot (or -s and -run, if you don't want to use a boot script)
Good luck. |
|
|
| Back to top |
|
| drakon |
Posted: Mon Sep 28, 2009 11:06 am |
|
|
|
Joined: 18 Sep 2009
Posts: 5
|
yeah. that sounds right.
it seems to be the thing im searching for.
ill check it this evening. know im gonna learn eiffel :p |
|
|
| Back to top |
|
|
|