Three different macros, two different implementations. Why isn't the second one based on \InputIfFileExists? I did so and all appears to work.
this depends to the different possibilities of calling \input. If you are sure, that you use only one way then you can delete the others.
However, using your original file and typeing this: $ rm -f *.aux *.log *.dvi $ latex test
I get ! LaTeX Error: Missing \begin{document}.
this is a problem with \include. I suppose that you included a complete tex file with some preamble stuff, at least \begin{document}
This occurs even if the body of the document is empty. Ie, if I have \begin{document} \end{document}
the included texfile can have only a body. This is different to LyX where you have complete LyX files.
[EMAIL PROTECTED] \IfFileExists{#1}{\@@[EMAIL PROTECTED]@[EMAIL PROTECTED] }
this one is called from include,. It does some checks and then call itself input
Herbert