###Function###
FileWrite

###Description###
Append a text/data to the end of a previously opened file.

###Syntax###
FileWrite ( "filehandle/filename", "text/data" )


###Parameters###
@@ParamTable@@
filehandle/filename
	The handle of a file, as returned by a previous call to <a href="FileOpen.htm">FileOpen()</a>. Alternatively, you may use a string filename as the first parameter.
text/data
	The text/data to write to the file. The text is written as is - no @CR or @LF characters are added. See remark for data type.
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	1.
Failure:	0 if file not opened in writemode, file is read only, or file cannot otherwise be written to.
@@End@@


###Remarks###
The file must be opened in write mode or the <a href="FileWrite.htm">FileWrite()</a> command will fail.

If a filename is given rather than a file handle, the file will be opened and closed during the function call.  For parsing large text files this will be much slower than using filehandles.  However, filename will be created if it does not already exist.

Note: Do not mix filehandles and filenames, i.e., don't <a href="FileOpen.htm">FileOpen()</a> a file and then use a filename in this function. Either use filehandles or filenames in your routines, not both.

When writing text AutoIt will write using ANSI by default. To write in Unicode mode the file must be opened with <a href="FileOpen.htm">FileOpen()</a> and the relevant flags.


If the data is a binary type variant (and not text) it will be written to the file byte by byte. Binary operation can also be forced by using <a href="FileOpen.htm">FileOpen()</a> with the binary flag.


###Related###
FileFlush, FileOpen, FileRead, FileReadLine, FileWriteLine, Binary, FileSetPos, FileGetPos


###Example###
@@IncludeExample@@
