filepath

Ian Lynagh igloo at earth.li
Sun Dec 9 18:35:28 EST 2007


On Sun, Dec 09, 2007 at 10:49:02PM +0000, Duncan Coutts wrote:
> 
> On Sun, 2007-12-09 at 22:08 +0000, Ian Lynagh wrote:
> > On Sun, Dec 09, 2007 at 08:20:15PM +0000, Duncan Coutts wrote:
> > > 
> > > On Sun, 2007-12-09 at 20:00 +0000, Ian Lynagh wrote:
> > > > On Sun, Dec 09, 2007 at 11:47:43AM -0800, Bryan O'Sullivan wrote:
> > > > > 
> > > > > As you can now imagine, this has no relation to how a Haskell program
> > > > > should be manipulating paths.
> > > > 
> > > > It also affects rawSystem:
> > > > 
> > > >     $ ghc -e 'System.Cmd.rawSystem "s" []'
> > > >     ExitFailure 127
> > > >     $ ghc -e 'System.Cmd.rawSystem "./s" []'
> > > >     hi
> > > >     ExitSuccess
> > > > 
> > > > but I'm not convinced that isn't a bug too.
> > > 
> > > That is because it also uses the system path. See execvp vs execve.
> > 
> > Right, but is that what it ought to do?
> 
> If not there's no way to execute a program that lives in the current
> directory if there is also a program by that name earlier on the search
> path, like in /bin.

I'm not sure we're on the same wavelength. What I mean is, should
rawSystem use execvp rather than execv? Or should both options be
available?

> If exec "./true" and "true" have to run the same program.
> 
> So the point is when it comes to search paths, a ./ path is not really
> relative at all.

I don't understand that.


Thanks
Ian



More information about the Libraries mailing list