问题
Merry Christmas to everybody. I'm having a dilemma with a perl script. In my script, I call another program with a system call, but I got this error:
Can't exec "./Classificador/svm_classify": No such file or directory at Analise_de_Sentimentos_mudanca.pl line 463.
I don't know if there is a problem in having my program in a different directory than the called program.
Another curious thing is that this script used to run normally in Ubuntu 10.10. But now I've changed to Mint 14. Is it missing some library?
Best wishes,
Thiago
回答1:
Does this "./Classificador/svm_classify" exists ? Check the following :
1) to go the directory where this file lays - Analise_de_Sentimentos_mudanca.pl
2) run :
ll Classificador/svm_classify
3) show us the results
回答2:
The relative pathname ./Classificador/svm_classify
is interpreted relative to the user's current directory, not the directory containing the perl script. You need to do one of the following:
- The user must
cd
to the directory containing the perl script before running it. - The perl script should call
chdir()
to set the current directory to the directory where it's stored. - Put the absolute pathname in the script, instead of
./
.
来源:https://stackoverflow.com/questions/14032741/cant-exec-no-such-file-or-directory