"escript: keine solche Datei oder das Verzeichnis:" Fehler

%cat Tatsache

#!/usr/bin/env escript
%% -*- erlang -*-
%%! -smp enable -sname factorial -mnesia debug verbose
main([String]) ->
    try
        N = list_to_integer(String),
        F = fac(N),
        io:format("factorial ~w = ~w\n", [N,F])
    catch
        _:_ ->
            usage()
    end;
main(_) ->
    usage().

usage() ->
    io:format("usage: factorial integer\n"),
    halt(1).

fac(0) -> 1;
fac(N) -> N * fac(N-1).

%./Tatsache, "5"

escript: no such file or directory: './Tat'

%whereis escript

escript: /usr/bin/escript

%pacman -Qi erlang

name : erlang
version : R14B04-1

Warum doesnot escript ausgeführt "Tatsache" ?


Auf meinem Archlinux-box, escript noch doesnot Arbeit !

%cat hello.erl 
main(_) -> io:fwrite("~p~n", "hello,world!").

%escript hello.erl 
escript: no such file or directory: 'hello.erl'

%whereis escript 
escript: /usr/bin/escript

%ls -l /usr/bin/escript
lrwxrwxrwx 1 root root 25 1218 17:37 /usr/bin/escript -> ../lib/erlang/bin/escript*

%/usr/lib/erlang/bin/escript hello.erl 
escript: no such file or directory: 'hello.erl'

%strace -f -F -o aaa.txt /usr/lib/erlang/bin/escript hello.erl 
escript: no such file or directory: 'hello.erl
%cat aaa.txt
execve("/usr/lib/erlang/bin/escript", ["/usr/lib/erlang/bin/escript", "hello.erl"], [/* 40 vars */]) = 0
...
open("hello.erl", O_RDONLY|O_LARGEFILE) = 3
...
execve("/usr/lib/erlang/bin/erl", ["/usr/lib/erlang/bin/erl", "+B", "-boot", "start_clean", "-noshell", "-run", "escript", "start", "-extra", "hello.erl"], [/* 40 vars */]) = 0.
...
stat64("hello.erl", 0xb5a44d90)   = -1 ENOENT (No such file or directory)
open("hello.erl", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
......

Warum funktioniert es mit "stat64" statt "stat" ? Ich bin mit 32-bit-system.

%uname -a
Linux myarch 3.1.5-1-ARCH #1 SMP PREEMPT Sun Dec 11 06:26:14 UTC 2011 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ AuthenticAMD GNU/Linux
%erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.8.5

GRÜßEN!


%ls
fact*
%escript fact "5" 
escript: no such file or directory: 'fact'
%escript fact 5  
escript: no such file or directory: 'fact

%ls -l /usr/bin/escript 
lrwxrwxrwx 1 root root 25 1015 03:24 /usr/bin/escript -> ../lib/erlang/bin/escript*

Seltsames problem ?

InformationsquelleAutor z_axis | 2011-12-11
Schreibe einen Kommentar