Index: trunk/src/inc/FileHandler.class.php
===================================================================
--- trunk/src/inc/FileHandler.class.php	(revision 7779)
+++ trunk/src/inc/FileHandler.class.php	(revision 7780)
@@ -50,4 +50,10 @@
 	}
 
+	
+	
+
+	
+	
+	
 	/*
 	 * Function: write
@@ -57,7 +63,37 @@
 	 */
 	public function write($data) {
-		// TODO David: Make write function
+		
+		$filename = date( "m_d_y.kml" );
+		
+			
+			try{
+				trigger_log(SYSLOG_DEBUG, 'Opening the file "' . $filename . '"', __FILE__, __LINE__);
+				$file = new FileHandler($filename, 'w');
+			} catch (Exception $err) {
+				trigger_log(SYSLOG_ERR, 'Opening the file "' . $filename . '"', __FILE__, __LINE__);
+				return false;
+			}
+	
+			try{
+			trigger_log(SYSLOG_DEBUG, 'Writing file "' . $filename . '"', __FILE__, __LINE__);
+			$file->write($file,$this->$data);
+			} catch (Exception $err) {
+				trigger_log(SYSLOG_ERR, 'Writing the file "' . $filename . '"', __FILE__, __LINE__);
+				return false;
+			}
+	
+			
+			try{
+			trigger_log(SYSLOG_DEBUG, 'Closing file "' . $filename . '"', __FILE__, __LINE__);
+			fclose($file);
+			} catch (Exception $err) {
+				trigger_log(SYSLOG_ERR, 'Closing the file "' . $filename . '"', __FILE__, __LINE__);
+				return false;
+			}
+			
+			return true;
+			
 
-		return false;
+		
 	}
 
