# if the remote file exists then include it, else include the local one

Here's the path where my tex file stands :

``````/home/me/documents/foo.tex
``````

I also have one import file here :

``````/home/me/texmf/tex/latex/personal/bar.tex
``````

However for security purpose I also include it here locally :

``````/home/me/documents/bar.tex
``````

When I input it in my tex file, e.g. :

``````\input{bar}
``````

I noticed the local file is used over the remote one (latex personal directory)

My question is : how can I manage the following statement ?

• If the distant file exists then include it over the local one.
• If the distant file is none then include the local one.
-