thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <jensge...@hotmail.com>
Subject RE: "program not found" and "could not open input file" (was: THRIFT-2800)
Date Fri, 05 Dec 2014 19:17:10 GMT
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





Mime
View raw message