\subsubsection*{Purpose}
Reads a file and puts it's content in a buffer.
\subsubsection*{Prototype}
\code{euint32 file\_write(File *file, euint32 size, euint8 *buf)}
\subsubsection*{Arguments}
Objects passed to \code{file\_read}:
\begin{itemize}
	\item{\code{file}: pointer to a File object}
	\item{\code{size}: amount of bytes you want to write}
	\item{\code{buf}: pointer to the buffer you want to write the data from}
\end{itemize}
\subsubsection*{Return value}
Returns the amount of bytes written.
\subsubsection*{Example}
\lstset{numbers=left, stepnumber=1, numberstyle=\small, numbersep=5pt, tabsize=4}
\begin{lstlisting}
	#include <string.h>
	#include "efs.h"

	void main(void)
	{
		EmbeddedFileSystem efsl;
		euint8 *buffer = "This is a test.\n";
		euint16 e=0;
		File file;

		/* Initialize efsl */
		DBG((TXT("Will init efsl now.\n")));
		if(efs_init(&efsl,"/dev/sda")!=0){
			DBG((TXT("Could not initialize filesystem (err \%d).\n"),ret));
			exit(-1);
		}
		DBG((TXT("Filesystem correctly initialized.\n")));

		/* Open file for writing */
		if(file_fopen(&file, &efsl.myFs, "write.txt", 'w')!=0){
			DBG((TXT("Could not open file for writing.\n")));
			exit(-1);
		}
		DBG((TXT("File opened for reading.\n")));

		/* Write buffer to file */
		if( file_write(&file,strlen(buffer),buffer) == strlen(buffer) )
			DBG((TXT("File written.\n")));
		else
			DBG((TXT("Could not write file.\n")));
		
		/* Close file & filesystem */
		fclose(&file);
		fs_umount(&efs.myFs);
	}
\end{lstlisting}
