[ExtractStream] Re: Released: TyTool alpha #1.

Christian Wiedmann wiedmann at w...
Fri, 31 May 2002 10:02:38 -0700 (PDT)


Actually, system(3) runs its commands using /bin/sh, so it already should
be checking the path. Just skip the leading path elements (try
system("NowShowing.tcl") instead of system("./NowShowing.tcl")).

Also, stat(2) is an easy (and fast) way to test for existence of a file.
This also tells you the permssions so you don't need to make a second call
to get them if you need them.

-Christian

On Fri, 31 May 2002, jewser wrote:

> --- In ExtractStream@y..., Michael Loftis <mloftis@w...> wrote:
> > Should be easy enough just pull out the path members, add
> > /NowShowing.tcl to it, then see if you can fopen it. If that works
> > you've made a match, you can get fancy and check permissions but
> > you shouldn't need to.
>
> My thoughts exactly. Then I just make a system call to get the
> output. So I just replace the system call string with the built one
> that exists and Shazam!
>
> --jdiner
>