spawnPipeWithPATH' :: MonadIO m => Maybe ([FilePath] -> [FilePath])
                      -> FilePath -> [String] -> m (Handle, ProcessID)
spawnPipeWithPATH' mf x xs = io $ do
                        (rd, wr) <- createPipe
                        setFdOption wr CloseOnExec True
                        h <- fdToHandle wr
                        hSetBuffering h LineBuffering
                        p <- xfork $ do
                              _ <- dupTo rd stdInput
                              executeFileWithPATH x mf xs Nothing
                        closeFd rd
                        return (h, p)
spawnPipeWithPATH' :: MonadIO m => Maybe ([FilePath] -> [FilePath])
                      -> FilePath -> [String] -> m (Handle, ProcessID)
spawnPipeWithPATH' mf x xs = io $ do
                        (rd, wr) <- createPipe
                        setFdOption wr CloseOnExec True
                        h <- fdToHandle wr
                        hSetBuffering h LineBuffering
                        p <- xfork $ do
                              _ <- dupTo rd stdInput
                              executeFileWithPATH x mf xs Nothing
                        closeFd rd
                        return (h, p)
spawnPipeWithPATH' mf x xs = io $ do
                        (rd, wr) <- createPipe
                        setFdOption wr CloseOnExec True
                        h <- fdToHandle wr
                        hSetBuffering h LineBuffering
                        p <- xfork $ do
                              _ <- dupTo rd stdInput
                              executeFileWithPATH x mf xs Nothing
                        closeFd rd
                        return (h, p)