-- Modify PATH using supplied function and use resulting path list when
-- searching for command (if command name does not contain slashes). Search
-- behavior conforms to execve() behavior, but PATH search itself is performed
-- here with modified path list.
executeFileWithPATH :: FilePath -> Maybe ([FilePath] -> [FilePath])
                       -> [String] -> Maybe [(String, String)] -> IO a
executeFileWithPATH cmd mf args env = do
    c <- searchPATH cmd mf
    -- Path c 
    executeFile c True args env

-- Versions of spawnX', which allow to modify PATH.
executeFileWithPATH :: FilePath -> Maybe ([FilePath] -> [FilePath])
                       -> [String] -> Maybe [(String, String)] -> IO a
executeFileWithPATH cmd mf args env = do
    c <- searchPATH cmd mf
    -- Path c 
    executeFile c True args env

-- Versions of spawnX', which allow to modify PATH.
executeFileWithPATH cmd mf args env = do
    c <- searchPATH cmd mf
    -- Path c 
    executeFile c True args env

-- Versions of spawnX', which allow to modify PATH.