Can't exec No such file or directory

霸气de小男生 提交于 2020-01-06 09:53:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!