Are there any ways to do control flow depending on the compilation method?

I would like to do something like

\if{\pdflatex}{
\includepdf{file.pdf}
}

\if{\latex}{
\epsfig{file.eps}
}

Maybe this isn't the best example, but do control-flow solutions exist in LaTeX to let us do something depending on how we compile?

-