Index: trunk/src/lib/Makefile.am
===================================================================
--- trunk/src/lib/Makefile.am	(revision 8324)
+++ trunk/src/lib/Makefile.am	(revision 8330)
@@ -25,8 +25,10 @@
 		util/loading/factory.cc \
 		util/loading/dynamic_loader.cc \
+		\
+		util/filesys/file.cc \
+		util/filesys/directory.cc \
+		\
 		util/preferences.cc \
 		util/threading.cc \
-		util/file.cc \
-		util/directory.cc \
 		util/timer.cc \
 		\
@@ -49,8 +51,9 @@
 		util/executor/functor_list.h \
 		\
+		util/filesys/file.h \
+		util/filesys/directory.h \
+		\
 		util/preferences.h \
 		util/threading.h \
-		util/file.h \
-		util/directory.h \
 		util/timer.h \
 		\
Index: trunk/src/lib/graphics/importer/bsp_file.cc
===================================================================
--- trunk/src/lib/graphics/importer/bsp_file.cc	(revision 8324)
+++ trunk/src/lib/graphics/importer/bsp_file.cc	(revision 8330)
@@ -22,5 +22,6 @@
 #include "bsp_tree_node.h"
 #include <fstream>
-#include "file.h"
+#include "util/loading/resource_manager.h"
+
 #include <sys/stat.h>
 #include <string.h>
@@ -31,5 +32,4 @@
 #include "base_object.h"
 #include "vector.h"
-#include "util/loading/resource_manager.h"
 #include "movie_player.h"
 
Index: trunk/src/lib/parser/ini_parser/Makefile.am
===================================================================
--- trunk/src/lib/parser/ini_parser/Makefile.am	(revision 8324)
+++ trunk/src/lib/parser/ini_parser/Makefile.am	(revision 8330)
@@ -1,2 +1,4 @@
+INCLUDES=-I../../util
+
 
 noinst_LIBRARIES = libIniParser.a
Index: trunk/src/lib/parser/ini_parser/ini_parser.h
===================================================================
--- trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 8324)
+++ trunk/src/lib/parser/ini_parser/ini_parser.h	(revision 8330)
@@ -11,5 +11,5 @@
 #define PARSELINELENGHT     512       //!< how many chars to read at once
 
-#include "src/lib/util/file.h"
+#include "filesys/file.h"
 #include <list>
 
Index: trunk/src/lib/shell/shell_completion_plugin.cc
===================================================================
--- trunk/src/lib/shell/shell_completion_plugin.cc	(revision 8324)
+++ trunk/src/lib/shell/shell_completion_plugin.cc	(revision 8330)
@@ -25,5 +25,5 @@
 #include "loading/resource_manager.h"
 
-#include "directory.h"
+#include "filesys/directory.h"
 #include "debug.h"
 
Index: trunk/src/lib/util/directory.cc
===================================================================
--- trunk/src/lib/util/directory.cc	(revision 8324)
+++ 	(revision )
@@ -1,157 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-
-   Borrowed the Main code from 'Bart Vanhauwaert' (license below)
-   and adopted it to my likings.
-*/
-
-/**
- * Copyright (C) 2002 Bart Vanhauwaert
- *
- * Permission to use, copy, modify, distribute and sell this software
- * for any purpose is hereby granted without fee. This license
- * includes (but is not limited to) standalone compilation or as part
- * of a larger project.
- *
- * This software is provided "as is" without express or implied warranty.
- *
- * For a full statement on warranty and terms and conditions for
- * copying, distribution and modification, please see the comment block
- * at the end of this file.
- *
- * Version 1
- *
- */
-
-#include "directory.h"
-
-#if not defined (__WIN32__)
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#else
-#include <windows.h>
-#include <winbase.h>
-#endif
-
-#include <iostream>
-
-/**
- * @brief Constructs a Directory handler.
- * @param directoryName the name of the Directory to access.
- */
-Directory::Directory(const std::string& directoryName)
-    : File(directoryName)
-{
-  this->_opened = false;
-}
-
-/**
- * @brief destructs the Directory.
- */
-Directory::~Directory()
-{
-  this->close();
-}
-
-
-/**
- * @brief openes the Directory
- * @returns true on success, false on error. (does not exist, no rights -> test with functions of File)
- *
- * Fills the List of Files, and sets the Directory to open state
- */
-bool Directory::open()
-{
-  if (this->_opened)
-    this->close();
-
-  // Openes the Directory for reading:
-#if not defined(__WIN32__)
-  DIR* handle;
-  handle = opendir(this->name().c_str());
-  if (!handle)
-  {
-    std::cerr << "could not open directory " << this->name() << " for reading" << std::endl;
-    return false;
-  }
-#else
-  HANDLE handle;
-
-  // First check the attributes trying to access a non-Directory with
-  // FindFirstFile takes ages
-  DWORD attrs = GetFileAttributes(this->name().c_str());
-  if ( (attrs == 0xFFFFFFFF) || ((attrs && FILE_ATTRIBUTE_DIRECTORY) == 0) )
-  {
-    return false;
-  }
-  std::string Full(this->name());
-  // Circumvent a problem in FindFirstFile with c:\\* as parameter
-  if ( (Full.length() > 0) && (Full[Full.length()-1] != '\\') )
-    Full += "\\";
-  WIN32_FIND_DATA entry;
-  handle = FindFirstFile( (Full+"*").c_str(), &entry);
-  if (handle == INVALID_HANDLE_VALUE)
-  {
-    std::cerr << "could not open directory " << this->name() << " for reading" << std::endl;
-    return false;
-  }
-  else
-  {
-    this->_fileNames.push_back(entry.cFileName);
-  }
-#endif
-
-  // BUILDING the list of contained Files. (only the names)
-#if not defined(__WIN32__)
-  dirent* entry;
-  while ((entry = readdir(handle)) != NULL)
-    this->_fileNames.push_back(entry->d_name);
-  closedir(handle);
-#else
-  WIN32_FIND_DATA entry;
-  while ((int ok = FindNextFile(handle, &entry)) != 0)
-    this->_fileNames.push_back(entry.cFileName);
-  FindClose(handle);
-#endif
-  this->_opened = true;
-  return true;
-}
-
-/**
- * @brief closes the directory
- * @returns true.
- *
- * Clears the List of Files in the Directory.
- */
-bool Directory::close()
-{
-  this->_opened = false;
-  this->_fileNames.clear();
-  return true;
-}
-
-
-/**
- * @brief creates the directory
- * @returns true on success, false on error
- */
-bool Directory::create()
-{
-#if not defined (__WIN32__)
-  return (!mkdir(this->name().c_str(), 0777));
-#else
-  return (!CreateDirectory(this->name().c_str(), NULL));
-#endif
-}
Index: trunk/src/lib/util/directory.h
===================================================================
--- trunk/src/lib/util/directory.h	(revision 8324)
+++ 	(revision )
@@ -1,95 +1,0 @@
-/*!
- * @file directory.h
- * @brief Definition of the Directory Handler class
- */
-
-
-/**
- * Copyright (C) 2002 Bart Vanhauwaert
- *
- * Permission to use, copy, modify, distribute and sell this software
- * for any purpose is hereby granted without fee. This license
- * includes (but is not limited to) standalone compilation or as part
- * of a larger project.
- *
- * This software is provided "as is" without express or implied warranty.
- *
- * For a full statement on warranty and terms and conditions for
- * copying, distribution and modification, please see the comment block
- * at the end of this file.
- *
- * Version 1
- *
- */
-
-#ifndef __DIRECTORY_H_
-#define __DIRECTORY_H_
-
-#include "file.h"
-#include <vector>
-
-class Directory : public File
-{
-public:
-  Directory(const std::string& directoryName = "");
-  ~Directory();
-
-  virtual bool open();
-  virtual bool close();
-
-  bool create();
-
-  /** @returns if the Directory was opened */
-  bool isOpen() const { return this->_opened; }
-  /** @returns the FileCount (count of files contained in this directory) */
-  unsigned int fileCount() const { return _fileNames.size(); };
-  /** @returns the FileNames contained inside of the Directory */
-  const std::vector<std::string>& fileNames() const { return this->_fileNames; };
-  /** @returns the i'th FileName @param fileNumber the fileNumber (must not bigger than fileCount()) */
-  const std::string& operator[](unsigned int fileNumber) const { return this->_fileNames[fileNumber]; };
-  /** @returns a formated string containing the FileName, prepended with the directory-Name */
-  std::string fileNameInDir(unsigned int fileNumber) const { return this->name() + "/" + _fileNames[fileNumber]; };
-  /** @returns a File pointing to the File @param fileNumber the fileNumber (must not bigger than fileCount()) */
-  File getFile(unsigned int fileNumber) const { return File(fileNameInDir(fileNumber)); };
-
-private:
-  bool                        _opened;          //!< If the directory was opened.
-  std::vector<std::string>    _fileNames;       //!< The List of Files contained in the directory. (will be filled when open was called.)
-};
-
-#endif /* __DIRECTORY_H_ */
-
-/**
- *
- * The "library", above, refers to the collection of software functions
- * and/or data contained in this file, prepared so as to be conveniently
- * compiled and linked with application programs (which use some of those
- * functions and data) to form executables.
- *
- *                             NO WARRANTY
- *
- * 1. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
- * WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
- * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
- * OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
- * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
- * LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
- * THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
- *
- * 2. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
- * WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
- * AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
- * FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
- * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
- * LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
- * RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
- * FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
- * SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGES.
- *
- * END OF TERMS AND CONDITIONS
- *
- */
-
Index: trunk/src/lib/util/file.cc
===================================================================
--- trunk/src/lib/util/file.cc	(revision 8324)
+++ 	(revision )
@@ -1,376 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-#include "file.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-
-#include <iostream>
-#include <fstream>
-
-#ifdef __unix__ 
-#include <unistd.h>
-#elif __WIN32__ || _MS_DOS_
-#include <dir.h>
-#else
-//#include <direct.h>
-#endif
-
-#include <cassert>
-
-/**
- * @brief default constructor.
- */
-File::File()
-{
-  this->init();
-}
-
-/**
- * @brief A File will be constructed and stated from a given FileName.
- * @param fileName the FileName to load and stat.
- */
-File::File(const std::string& fileName)
-{
-  this->init();
-  this->setFileName(fileName);
-}
-
-/**
- * @brief A File will be constructed and stated from a given other File.
- * @param file the File to get the Name from.
- */
-File::File(const File& file)
-{
-  this->init();
-  this->setFileName(file.name());
-}
-
-File::~File()
-{
-  this->close();
-
-  if (this->_status)
-    delete this->_status;
-}
-
-
-/**
- * @brief initializes the File
- *
- * Stats the File, looks if it exists and sets the hadle to 0
- */
-void File::init()
-{
-  this->_handle = 0;
-  this->_status = NULL;
-}
-
-
-/**
- * @brief sets a new File to apply to this File.
- * @param fileName the Filename of the File to access.
- */
-void File::setFileName(const std::string& fileName)
-{
-  this->close();
-  this->_name = fileName;
-  File::homeDirCheck(this->_name);
-  this->statFile();
-}
-
-/**
- * @brief sets the file to the new File.
- * @param fileName the FileName to set the File to.
- * @returns this File.
- */
-File& File::operator=(const std::string& fileName)
-{
-  this->setFileName(fileName);
-  return *this;
-}
-
-/**
- * @brief sets the file to the new File.
- * @param file the File to set the File to.
- * @returns this File.
- */
-File& File::operator=(const File& file)
-{
-  this->setFileName(file.name());
-  return *this;
-}
-
-/**
- * @brief compares two files.
- * @param fileName the File to compare against the stored one.
- * @returns true if the filenames match.
- */
-bool File::operator==(const std::string& fileName) const
-{
-  return (this->_name == fileName);
-}
-
-/**
- * @brief compares two files.
- * @param file the File to compare against the stored one.
- * @returns true if the filenames match.
- */
-bool File::operator==(const File& file) const
-{
-  return (this->_name == file.name());
-}
-
-
-/**
- * @brief stats a File.
- * Gathers information about the File, like permissions, and if it exists.
- */
-void File::statFile()
-{
-  if (this->_status == NULL)
-    this->_status = new struct stat;
-  // Check the End of the FileName and chop away any \ and //
-  std::string name = this->_name;
-  while (name[name.size()-1] == '/' ||
-	 name[name.size()-1] == '\\')
-    name.resize(name.size()-1);
-  if (stat(name.c_str(), this->_status))
-  {
-    delete this->_status;
-    this->_status = NULL;
-  }
-}
-
-bool File::open(OpenMode mode)
-{
-#warning implement
-  return false;
-}
-
-bool File::close()
-{
-#warning implement
-  return false;
-}
-
-bool File::exists() const
-{
-  return (this->_status != NULL);
-}
-
-/**
- * @brief checks if the file is a Link (symlink/hardlink on UNIX)
- * @returns true if the File is a Link, false otherwise (on windows always false)
- */
-bool File::isLink() const
-{
-#ifndef __WIN32__
-  return (this->_status != NULL && this->_status->st_mode & (S_IFLNK));
-#else
-  return false;
-#endif
-}
-
-/**
- * @brief checks if the File is a regular File
- * @returns true if the File is a Regular file.
- */
-bool File::isFile() const
-{
-  return (this->_status != NULL && this->_status->st_mode & (S_IFREG));
-}
-
-/**
- * @brief Checks if the File is a Directory
- * @returns true if it is a directory/symlink false otherwise
- */
-bool File::isDirectory() const
-{
-  return (this->_status != NULL && this->_status->st_mode & (S_IFDIR));
-}
-
-
-/// FIXME NEXT THREE FUNCTIONS
-bool File::isReadeable() const
-{
-#ifndef __WIN32__
-  return (this->_status != NULL && this->_status->st_mode & (S_IRUSR));
-#else
-  return (this->_status != NULL);
-#endif
-}
-bool File::isWriteable() const
-{
-#ifndef __WIN32__
-  return (this->_status != NULL && this->_status->st_mode & (S_IWUSR));
-#else
-  return (this->_status != NULL);
-#endif
-}
-bool File::isExecutable() const
-{
-#ifndef __WIN32__
-  return (this->_status != NULL && this->_status->st_mode & (S_IXUSR));
-#else
-  return (this->_status != NULL);
-#endif
-}
-
-/**
- * @brief copies the File to another File.
- * @param destination the Destination File.
- * @returns true on success, false otherwise.
- */
-bool File::copy(const File& destination)
-{
-  if (*this == destination)
-  {
-    std::cout << "files are the Same '" << this->_name << "'\n";
-    return false;
-  }
-  char ch;
-  std::ifstream iFile(this->_name.c_str());
-  std::ofstream oFile(destination.name().c_str());
-  while (iFile.get(ch))
-  {
-    oFile.put(ch);
-  }
-  return true;
-}
-
-/**
- * @brief renames the File (move)
- * @param destination the Destination to move this file to.
- * @returns true on success, false otherwise.
- *
- * if the File was opened, it will be closed throuh this function.
- * The File will also be closed, if the File was not renamed.
- */
-bool File::rename(const File& destination)
-{
-  this->close();
-
-  if (!std::rename(this->_name.c_str(), destination.name().c_str()))
-  {
-    this->_name = destination.name();
-    this->statFile();
-    return true;
-  }
-  return false;
-}
-
-/**
- * @brief touches the File.
- * @returns true if the file could have been touched. false otherwise.
- *
- * Touching a File means creating it.
- */
-bool File::touch()
-{
-  FILE* stream;
-  if( (stream = fopen (this->_name.c_str(), "w")) == NULL)
-  {
-    std::cout << "could not touch '" << this->_name << "' for writing\n";
-    return false;
-  }
-  fclose(stream);
-
-  this->statFile();
-  return true;
-}
-
-/**
- * @brief delete the File on the Disk
- * @returns true on success, false otherwise.
- */
-bool File::remove()
-{
-  if (!this->exists())
-    return false;
-
-  this->close();
-  unlink(this->_name.c_str());
-  delete this->_status;
-  this->_status = NULL;
-
-  return true;
-}
-
-/**
- * @brief transforms a Relative path to an absolute one.
- * @param fileName the Absolute Path.
- */
-void File::relToAbs(std::string& relFileName)
-{
-  if (relFileName.empty())
-    return ;
-  if (relFileName[0] !=  '/')
-  {
-    if (relFileName[0] == '.' && relFileName[1] != '.')
-      relFileName.erase(0);
-    relFileName = File::cwd() + relFileName;
-  }
-}
-
-void File::absToRel(std::string& absFileName)
-{
-  if (absFileName.find(cwd()) == 0)
-    absFileName.replace(0, File::cwd().size(), ".");
-}
-
-
-std::string File::_cwd = "";
-
-/**
- * @returns the Current Woring Directory
- */
-const std::string& File::cwd()
-{
-  if (File::_cwd.empty())
-  {
-    char cwd[1024];
-    char* errorCode = getcwd(cwd, 1024);
-    if (errorCode == 0)
-      return File::_cwd;
-
-    File::_cwd = cwd;
-  }
-  return File::_cwd;
-}
-
-/**
- * @brief check if fileName has the '~/` prepended.
- * @returns the fileName in absolute coordinate.
- */
-void File::homeDirCheck(std::string& fileName)
-{
-  if (fileName.size() < 2 || fileName[0] != '~' || fileName[1] != '/')
-    return;
-  std::string homeDir;
-#ifdef __WIN32__
-  homeDir = getenv("USERPROFILE");
-#else
-  homeDir = getenv("HOME");
-#endif
-  fileName = homeDir + fileName.substr(1);
-}
-
-
-#include "file.h"
-
-
Index: trunk/src/lib/util/file.h
===================================================================
--- trunk/src/lib/util/file.h	(revision 8324)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/*!
- * @file file.h
- * @brief Definition of File Handler class
- */
-
-#ifndef __FILE_H_
-#define __FILE_H_
-
-
-#include <string>
-typedef struct stat;
-
-//! A Class to Handle Files.
-class File
-{
-  public:
-  //! How the File should be opened.
-  typedef enum
-  {
-    ReadOnly,      //!< ReadOnly mode
-    WriteOnly,     //!< WriteOnly mode
-    ReadWrite,     //!< Read and Write mode together
-    Append,        //!< Append at the end.
-  } OpenMode;
-
-public:
-  File();
-  File(const std::string& fileName);
-  File(const File& file);
-  virtual ~File();
-  void setFileName(const std::string& fileName);
-  File& operator=(const std::string& fileName);
-  File& operator=(const File& file);
-  bool operator==(const std::string& fileName) const;
-  bool operator==(const File& file) const;
-
-  virtual bool open(OpenMode mode);
-  virtual bool close();
-  int handle() const { return this->_handle; };
-
-  /** @returns the FileName of this File */
-  const std::string& name() const { return this->_name; };
-
-  bool exists() const;
-  bool isLink() const;
-  bool isFile() const ;
-  bool isDirectory() const;
-  bool isReadeable() const;
-  bool isWriteable() const;
-  bool isExecutable() const;
-
-
-  bool copy(const File& destination);
-  bool rename(const File& destination);
-  bool touch();
-  bool remove();
-
-  static void relToAbs(std::string& relFileName);
-  static void absToRel(std::string& absFileName);
-  static const std::string& cwd();
-
-  private:
-    void init();
-    void statFile();
-    void homeDirCheck(std::string& fileName);
-
-  private:
-    int                 _handle;          //!< The FileHandle (if set).
-    std::string         _name;            //!< The Name of the File.
-    stat*               _status;          //!< The Stat of the File.
-
-    static std::string  _cwd;             //!< The currend Working directory.
-
-};
-
-#endif /* __FILE_H_ */
Index: trunk/src/lib/util/filesys/directory.cc
===================================================================
--- trunk/src/lib/util/filesys/directory.cc	(revision 8330)
+++ trunk/src/lib/util/filesys/directory.cc	(revision 8330)
@@ -0,0 +1,157 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+
+   Borrowed the Main code from 'Bart Vanhauwaert' (license below)
+   and adopted it to my likings.
+*/
+
+/**
+ * Copyright (C) 2002 Bart Vanhauwaert
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * for any purpose is hereby granted without fee. This license
+ * includes (but is not limited to) standalone compilation or as part
+ * of a larger project.
+ *
+ * This software is provided "as is" without express or implied warranty.
+ *
+ * For a full statement on warranty and terms and conditions for
+ * copying, distribution and modification, please see the comment block
+ * at the end of this file.
+ *
+ * Version 1
+ *
+ */
+
+#include "directory.h"
+
+#if not defined (__WIN32__)
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#else
+#include <windows.h>
+#include <winbase.h>
+#endif
+
+#include <iostream>
+
+/**
+ * @brief Constructs a Directory handler.
+ * @param directoryName the name of the Directory to access.
+ */
+Directory::Directory(const std::string& directoryName)
+    : File(directoryName)
+{
+  this->_opened = false;
+}
+
+/**
+ * @brief destructs the Directory.
+ */
+Directory::~Directory()
+{
+  this->close();
+}
+
+
+/**
+ * @brief openes the Directory
+ * @returns true on success, false on error. (does not exist, no rights -> test with functions of File)
+ *
+ * Fills the List of Files, and sets the Directory to open state
+ */
+bool Directory::open()
+{
+  if (this->_opened)
+    this->close();
+
+  // Openes the Directory for reading:
+#if not defined(__WIN32__)
+  DIR* handle;
+  handle = opendir(this->name().c_str());
+  if (!handle)
+  {
+    std::cerr << "could not open directory " << this->name() << " for reading" << std::endl;
+    return false;
+  }
+#else
+  HANDLE handle;
+
+  // First check the attributes trying to access a non-Directory with
+  // FindFirstFile takes ages
+  DWORD attrs = GetFileAttributes(this->name().c_str());
+  if ( (attrs == 0xFFFFFFFF) || ((attrs && FILE_ATTRIBUTE_DIRECTORY) == 0) )
+  {
+    return false;
+  }
+  std::string Full(this->name());
+  // Circumvent a problem in FindFirstFile with c:\\* as parameter
+  if ( (Full.length() > 0) && (Full[Full.length()-1] != '\\') )
+    Full += "\\";
+  WIN32_FIND_DATA entry;
+  handle = FindFirstFile( (Full+"*").c_str(), &entry);
+  if (handle == INVALID_HANDLE_VALUE)
+  {
+    std::cerr << "could not open directory " << this->name() << " for reading" << std::endl;
+    return false;
+  }
+  else
+  {
+    this->_fileNames.push_back(entry.cFileName);
+  }
+#endif
+
+  // BUILDING the list of contained Files. (only the names)
+#if not defined(__WIN32__)
+  dirent* entry;
+  while ((entry = readdir(handle)) != NULL)
+    this->_fileNames.push_back(entry->d_name);
+  closedir(handle);
+#else
+  WIN32_FIND_DATA entry;
+  while ((int ok = FindNextFile(handle, &entry)) != 0)
+    this->_fileNames.push_back(entry.cFileName);
+  FindClose(handle);
+#endif
+  this->_opened = true;
+  return true;
+}
+
+/**
+ * @brief closes the directory
+ * @returns true.
+ *
+ * Clears the List of Files in the Directory.
+ */
+bool Directory::close()
+{
+  this->_opened = false;
+  this->_fileNames.clear();
+  return true;
+}
+
+
+/**
+ * @brief creates the directory
+ * @returns true on success, false on error
+ */
+bool Directory::create()
+{
+#if not defined (__WIN32__)
+  return (!mkdir(this->name().c_str(), 0777));
+#else
+  return (!CreateDirectory(this->name().c_str(), NULL));
+#endif
+}
Index: trunk/src/lib/util/filesys/directory.h
===================================================================
--- trunk/src/lib/util/filesys/directory.h	(revision 8330)
+++ trunk/src/lib/util/filesys/directory.h	(revision 8330)
@@ -0,0 +1,95 @@
+/*!
+ * @file directory.h
+ * @brief Definition of the Directory Handler class
+ */
+
+
+/**
+ * Copyright (C) 2002 Bart Vanhauwaert
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * for any purpose is hereby granted without fee. This license
+ * includes (but is not limited to) standalone compilation or as part
+ * of a larger project.
+ *
+ * This software is provided "as is" without express or implied warranty.
+ *
+ * For a full statement on warranty and terms and conditions for
+ * copying, distribution and modification, please see the comment block
+ * at the end of this file.
+ *
+ * Version 1
+ *
+ */
+
+#ifndef __DIRECTORY_H_
+#define __DIRECTORY_H_
+
+#include "file.h"
+#include <vector>
+
+class Directory : public File
+{
+public:
+  Directory(const std::string& directoryName = "");
+  ~Directory();
+
+  virtual bool open();
+  virtual bool close();
+
+  bool create();
+
+  /** @returns if the Directory was opened */
+  bool isOpen() const { return this->_opened; }
+  /** @returns the FileCount (count of files contained in this directory) */
+  unsigned int fileCount() const { return _fileNames.size(); };
+  /** @returns the FileNames contained inside of the Directory */
+  const std::vector<std::string>& fileNames() const { return this->_fileNames; };
+  /** @returns the i'th FileName @param fileNumber the fileNumber (must not bigger than fileCount()) */
+  const std::string& operator[](unsigned int fileNumber) const { return this->_fileNames[fileNumber]; };
+  /** @returns a formated string containing the FileName, prepended with the directory-Name */
+  std::string fileNameInDir(unsigned int fileNumber) const { return this->name() + "/" + _fileNames[fileNumber]; };
+  /** @returns a File pointing to the File @param fileNumber the fileNumber (must not bigger than fileCount()) */
+  File getFile(unsigned int fileNumber) const { return File(fileNameInDir(fileNumber)); };
+
+private:
+  bool                        _opened;          //!< If the directory was opened.
+  std::vector<std::string>    _fileNames;       //!< The List of Files contained in the directory. (will be filled when open was called.)
+};
+
+#endif /* __DIRECTORY_H_ */
+
+/**
+ *
+ * The "library", above, refers to the collection of software functions
+ * and/or data contained in this file, prepared so as to be conveniently
+ * compiled and linked with application programs (which use some of those
+ * functions and data) to form executables.
+ *
+ *                             NO WARRANTY
+ *
+ * 1. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+ * WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+ * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+ * OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+ * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+ * LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+ * THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+ *
+ * 2. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ * WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+ * AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+ * FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+ * LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+ * RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+ * FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+ * SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGES.
+ *
+ * END OF TERMS AND CONDITIONS
+ *
+ */
+
Index: trunk/src/lib/util/filesys/file.cc
===================================================================
--- trunk/src/lib/util/filesys/file.cc	(revision 8330)
+++ trunk/src/lib/util/filesys/file.cc	(revision 8330)
@@ -0,0 +1,376 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#include "file.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
+#include <iostream>
+#include <fstream>
+
+#ifdef __unix__ 
+#include <unistd.h>
+#elif __WIN32__ || _MS_DOS_
+#include <dir.h>
+#else
+//#include <direct.h>
+#endif
+
+#include <cassert>
+
+/**
+ * @brief default constructor.
+ */
+File::File()
+{
+  this->init();
+}
+
+/**
+ * @brief A File will be constructed and stated from a given FileName.
+ * @param fileName the FileName to load and stat.
+ */
+File::File(const std::string& fileName)
+{
+  this->init();
+  this->setFileName(fileName);
+}
+
+/**
+ * @brief A File will be constructed and stated from a given other File.
+ * @param file the File to get the Name from.
+ */
+File::File(const File& file)
+{
+  this->init();
+  this->setFileName(file.name());
+}
+
+File::~File()
+{
+  this->close();
+
+  if (this->_status)
+    delete this->_status;
+}
+
+
+/**
+ * @brief initializes the File
+ *
+ * Stats the File, looks if it exists and sets the hadle to 0
+ */
+void File::init()
+{
+  this->_handle = 0;
+  this->_status = NULL;
+}
+
+
+/**
+ * @brief sets a new File to apply to this File.
+ * @param fileName the Filename of the File to access.
+ */
+void File::setFileName(const std::string& fileName)
+{
+  this->close();
+  this->_name = fileName;
+  File::homeDirCheck(this->_name);
+  this->statFile();
+}
+
+/**
+ * @brief sets the file to the new File.
+ * @param fileName the FileName to set the File to.
+ * @returns this File.
+ */
+File& File::operator=(const std::string& fileName)
+{
+  this->setFileName(fileName);
+  return *this;
+}
+
+/**
+ * @brief sets the file to the new File.
+ * @param file the File to set the File to.
+ * @returns this File.
+ */
+File& File::operator=(const File& file)
+{
+  this->setFileName(file.name());
+  return *this;
+}
+
+/**
+ * @brief compares two files.
+ * @param fileName the File to compare against the stored one.
+ * @returns true if the filenames match.
+ */
+bool File::operator==(const std::string& fileName) const
+{
+  return (this->_name == fileName);
+}
+
+/**
+ * @brief compares two files.
+ * @param file the File to compare against the stored one.
+ * @returns true if the filenames match.
+ */
+bool File::operator==(const File& file) const
+{
+  return (this->_name == file.name());
+}
+
+
+/**
+ * @brief stats a File.
+ * Gathers information about the File, like permissions, and if it exists.
+ */
+void File::statFile()
+{
+  if (this->_status == NULL)
+    this->_status = new struct stat;
+  // Check the End of the FileName and chop away any \ and //
+  std::string name = this->_name;
+  while (name[name.size()-1] == '/' ||
+	 name[name.size()-1] == '\\')
+    name.resize(name.size()-1);
+  if (stat(name.c_str(), this->_status))
+  {
+    delete this->_status;
+    this->_status = NULL;
+  }
+}
+
+bool File::open(OpenMode mode)
+{
+#warning implement
+  return false;
+}
+
+bool File::close()
+{
+#warning implement
+  return false;
+}
+
+bool File::exists() const
+{
+  return (this->_status != NULL);
+}
+
+/**
+ * @brief checks if the file is a Link (symlink/hardlink on UNIX)
+ * @returns true if the File is a Link, false otherwise (on windows always false)
+ */
+bool File::isLink() const
+{
+#ifndef __WIN32__
+  return (this->_status != NULL && this->_status->st_mode & (S_IFLNK));
+#else
+  return false;
+#endif
+}
+
+/**
+ * @brief checks if the File is a regular File
+ * @returns true if the File is a Regular file.
+ */
+bool File::isFile() const
+{
+  return (this->_status != NULL && this->_status->st_mode & (S_IFREG));
+}
+
+/**
+ * @brief Checks if the File is a Directory
+ * @returns true if it is a directory/symlink false otherwise
+ */
+bool File::isDirectory() const
+{
+  return (this->_status != NULL && this->_status->st_mode & (S_IFDIR));
+}
+
+
+/// FIXME NEXT THREE FUNCTIONS
+bool File::isReadeable() const
+{
+#ifndef __WIN32__
+  return (this->_status != NULL && this->_status->st_mode & (S_IRUSR));
+#else
+  return (this->_status != NULL);
+#endif
+}
+bool File::isWriteable() const
+{
+#ifndef __WIN32__
+  return (this->_status != NULL && this->_status->st_mode & (S_IWUSR));
+#else
+  return (this->_status != NULL);
+#endif
+}
+bool File::isExecutable() const
+{
+#ifndef __WIN32__
+  return (this->_status != NULL && this->_status->st_mode & (S_IXUSR));
+#else
+  return (this->_status != NULL);
+#endif
+}
+
+/**
+ * @brief copies the File to another File.
+ * @param destination the Destination File.
+ * @returns true on success, false otherwise.
+ */
+bool File::copy(const File& destination)
+{
+  if (*this == destination)
+  {
+    std::cout << "files are the Same '" << this->_name << "'\n";
+    return false;
+  }
+  char ch;
+  std::ifstream iFile(this->_name.c_str());
+  std::ofstream oFile(destination.name().c_str());
+  while (iFile.get(ch))
+  {
+    oFile.put(ch);
+  }
+  return true;
+}
+
+/**
+ * @brief renames the File (move)
+ * @param destination the Destination to move this file to.
+ * @returns true on success, false otherwise.
+ *
+ * if the File was opened, it will be closed throuh this function.
+ * The File will also be closed, if the File was not renamed.
+ */
+bool File::rename(const File& destination)
+{
+  this->close();
+
+  if (!std::rename(this->_name.c_str(), destination.name().c_str()))
+  {
+    this->_name = destination.name();
+    this->statFile();
+    return true;
+  }
+  return false;
+}
+
+/**
+ * @brief touches the File.
+ * @returns true if the file could have been touched. false otherwise.
+ *
+ * Touching a File means creating it.
+ */
+bool File::touch()
+{
+  FILE* stream;
+  if( (stream = fopen (this->_name.c_str(), "w")) == NULL)
+  {
+    std::cout << "could not touch '" << this->_name << "' for writing\n";
+    return false;
+  }
+  fclose(stream);
+
+  this->statFile();
+  return true;
+}
+
+/**
+ * @brief delete the File on the Disk
+ * @returns true on success, false otherwise.
+ */
+bool File::remove()
+{
+  if (!this->exists())
+    return false;
+
+  this->close();
+  unlink(this->_name.c_str());
+  delete this->_status;
+  this->_status = NULL;
+
+  return true;
+}
+
+/**
+ * @brief transforms a Relative path to an absolute one.
+ * @param fileName the Absolute Path.
+ */
+void File::relToAbs(std::string& relFileName)
+{
+  if (relFileName.empty())
+    return ;
+  if (relFileName[0] !=  '/')
+  {
+    if (relFileName[0] == '.' && relFileName[1] != '.')
+      relFileName.erase(0);
+    relFileName = File::cwd() + relFileName;
+  }
+}
+
+void File::absToRel(std::string& absFileName)
+{
+  if (absFileName.find(cwd()) == 0)
+    absFileName.replace(0, File::cwd().size(), ".");
+}
+
+
+std::string File::_cwd = "";
+
+/**
+ * @returns the Current Woring Directory
+ */
+const std::string& File::cwd()
+{
+  if (File::_cwd.empty())
+  {
+    char cwd[1024];
+    char* errorCode = getcwd(cwd, 1024);
+    if (errorCode == 0)
+      return File::_cwd;
+
+    File::_cwd = cwd;
+  }
+  return File::_cwd;
+}
+
+/**
+ * @brief check if fileName has the '~/` prepended.
+ * @returns the fileName in absolute coordinate.
+ */
+void File::homeDirCheck(std::string& fileName)
+{
+  if (fileName.size() < 2 || fileName[0] != '~' || fileName[1] != '/')
+    return;
+  std::string homeDir;
+#ifdef __WIN32__
+  homeDir = getenv("USERPROFILE");
+#else
+  homeDir = getenv("HOME");
+#endif
+  fileName = homeDir + fileName.substr(1);
+}
+
+
+#include "file.h"
+
+
Index: trunk/src/lib/util/filesys/file.h
===================================================================
--- trunk/src/lib/util/filesys/file.h	(revision 8330)
+++ trunk/src/lib/util/filesys/file.h	(revision 8330)
@@ -0,0 +1,76 @@
+/*!
+ * @file file.h
+ * @brief Definition of File Handler class
+ */
+
+#ifndef __FILE_H_
+#define __FILE_H_
+
+
+#include <string>
+typedef struct stat;
+
+//! A Class to Handle Files.
+class File
+{
+  public:
+  //! How the File should be opened.
+  typedef enum
+  {
+    ReadOnly,      //!< ReadOnly mode
+    WriteOnly,     //!< WriteOnly mode
+    ReadWrite,     //!< Read and Write mode together
+    Append,        //!< Append at the end.
+  } OpenMode;
+
+public:
+  File();
+  File(const std::string& fileName);
+  File(const File& file);
+  virtual ~File();
+  void setFileName(const std::string& fileName);
+  File& operator=(const std::string& fileName);
+  File& operator=(const File& file);
+  bool operator==(const std::string& fileName) const;
+  bool operator==(const File& file) const;
+
+  virtual bool open(OpenMode mode);
+  virtual bool close();
+  int handle() const { return this->_handle; };
+
+  /** @returns the FileName of this File */
+  const std::string& name() const { return this->_name; };
+
+  bool exists() const;
+  bool isLink() const;
+  bool isFile() const ;
+  bool isDirectory() const;
+  bool isReadeable() const;
+  bool isWriteable() const;
+  bool isExecutable() const;
+
+
+  bool copy(const File& destination);
+  bool rename(const File& destination);
+  bool touch();
+  bool remove();
+
+  static void relToAbs(std::string& relFileName);
+  static void absToRel(std::string& absFileName);
+  static const std::string& cwd();
+
+  private:
+    void init();
+    void statFile();
+    void homeDirCheck(std::string& fileName);
+
+  private:
+    int                 _handle;          //!< The FileHandle (if set).
+    std::string         _name;            //!< The Name of the File.
+    stat*               _status;          //!< The Stat of the File.
+
+    static std::string  _cwd;             //!< The currend Working directory.
+
+};
+
+#endif /* __FILE_H_ */
Index: trunk/src/lib/util/loading/resource_manager.cc
===================================================================
--- trunk/src/lib/util/loading/resource_manager.cc	(revision 8324)
+++ trunk/src/lib/util/loading/resource_manager.cc	(revision 8330)
@@ -17,5 +17,4 @@
 
 #include "util/loading/resource_manager.h"
-#include "file.h"
 #include "substring.h"
 #include "debug.h"
Index: trunk/src/lib/util/loading/resource_manager.h
===================================================================
--- trunk/src/lib/util/loading/resource_manager.h	(revision 8324)
+++ trunk/src/lib/util/loading/resource_manager.h	(revision 8330)
@@ -21,5 +21,5 @@
 
 #include "base_object.h"
-#include "file.h"
+#include "filesys/file.h"
 
 #include "multi_type.h"
