You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Jens Geyer <je...@hotmail.com> on 2014/12/05 20:17:10 UTC

RE: "program not found" and "could not open input file" (was: THRIFT-2800)

Hi saber hattay,

> When I run the command : thrift -r --gen js tutorial.thrift
> from this folder, the bash shell return command not found.

With *nix shells you have to put an explicit  ./ in front:

    ./thrift -gen js whatever.thrift.


The shell does not look up the current folder when searching for 
executables, so you have to tell that the program is located in the current 
folder.

> And from a command Dos, the shell return "could not opend input file 
> D:/..../tutorial.thrift".

Because any program looks for the file in the current working directory 
(CWD), if no explicit path is given.
Example: If the file myfile.thrift file is located under C:\Foo and 
thrift.exe is located under  D:\Bar, you could do this:

    c:
    cd \foo
    d:\bar\thrift -gen js myfile.thrift


alternatively

    d:
    cd \bar
    thrift -gen js c:\foo\myfile.thrift


or the one-liner

    d:\bar\thrift -gen js c:\foo\myfile.thrift

Helpful links:
- http://www.computerhope.com/issues/chusedos.htm
- 
http://askubuntu.com/questions/320632/why-do-i-need-to-type-before-executing-a-program-in-the-current-directory

Have fun,
JensG