\documentclass[a5]{article}
\usepackage{color}
\usepackage{listings}
\lstnewenvironment{file}[1][]{%
  \medskip\noindent\texttt{\color{red}#1}
  \lstset{basicstyle=\ttfamily\small,frame=single}}{\medskip}
\begin{document}

lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text


\begin{file}[Environment file]
\lstnewenvironment{file}[1][]{%
  \noindent\texttt{#1}
  \lstset{basicstyle=\ttfamily\small,frame=single}}{}
\end{file}

lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text
lorum ipsum and some other ind of nonsense text


\end{document} 