+int MSG_file_unlink(msg_file_t fd)
+{
+ msg_file_priv_t priv = MSG_file_priv(fd);
+ int res = simcall_file_unlink(priv->simdata->smx_file);
+ return res;
+}
+
+/** \ingroup msg_file_management
+ * \brief Return the size of a file
+ *
+ * \param fd is the file descriptor (#msg_file_t)
+ * \return the size of the file (as a #sg_size_t)
+ */
+sg_size_t MSG_file_get_size(msg_file_t fd){
+ msg_file_priv_t priv = MSG_file_priv(fd);
+ return simcall_file_get_size(priv->simdata->smx_file);
+}
+
+/** \ingroup msg_file_management
+ * \brief Search for file
+ *
+ * \param mount is the mount point where find the file is located
+ * \param path the file regex to find
+ * \return a xbt_dict_t of file where key is the name of file and the
+ * value the msg_stat_t corresponding to the key
+ */
+xbt_dict_t MSG_file_ls(const char *mount, const char *path)
+{
+ xbt_assert(path,"You must set path");
+ int size = strlen(path);
+ if(size && path[size-1] != '/')
+ {
+ char *new_path = bprintf("%s/",path);
+ XBT_DEBUG("Change '%s' for '%s'",path,new_path);
+ xbt_dict_t dict = simcall_file_ls(mount, new_path);
+ xbt_free(new_path);
+ return dict;
+ }
+
+ return simcall_file_ls(mount, path);
+}
+
+/**
+ * \ingroup msg_file_management
+ * \brief Set the file position indicator in the msg_file_t by adding offset bytes
+ * to the position specified by origin (either SEEK_SET, SEEK_CUR, or SEEK_END).
+ *
+ * \param fd : file object that identifies the stream
+ * \param offset : number of bytes to offset from origin
+ * \param origin : Position used as reference for the offset. It is specified by
+ * one of the following constants defined in \<stdio.h\> exclusively to be used as
+ * arguments for this function (SEEK_SET = beginning of file, SEEK_CUR = current
+ * position of the file pointer, SEEK_END = end of file)
+ *
+ * \return If successful, the function returns MSG_OK (=0). Otherwise, it returns
+ * MSG_TASK_CANCELED (=8).
+ *
+ */
+msg_error_t MSG_file_seek(msg_file_t fd, sg_size_t offset, int origin)
+{
+ msg_file_priv_t priv = MSG_file_priv(fd);
+ return simcall_file_seek(priv->simdata->smx_file, offset, origin);
+}
+
+/**
+ * \ingroup msg_file_management
+ * \brief Returns the current value of the position indicator of the file
+ *
+ * \param fd : file object that identifies the stream
+ * \return On success, the current value of the position indicator is returned.
+ *
+ */
+sg_size_t MSG_file_tell(msg_file_t fd)
+{
+ msg_file_priv_t priv = MSG_file_priv(fd);
+ return simcall_file_tell(priv->simdata->smx_file);
+}
+
+const char *MSG_file_get_name(msg_file_t fd) {
+ xbt_assert((fd != NULL), "Invalid parameters");
+ msg_file_priv_t priv = MSG_file_priv(fd);
+ return priv->fullpath;
+}
+
+
+/*
+ * \brief Destroys a file (internal call only)
+ */
+void __MSG_file_destroy(msg_file_priv_t file) {
+ xbt_free(file->fullpath);
+ xbt_free(file->simdata);
+ xbt_free(file);
+}
+/********************************* Storage **************************************/
+
+/** @addtogroup msg_storage_management
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Storages" --> \endhtmlonly
+ * (#msg_storage_t) and the functions for managing it.
+ *
+ */
+
+msg_storage_t __MSG_storage_create(smx_storage_t storage)
+{
+ const char *name = SIMIX_storage_get_name(storage);
+ const char *host = SIMIX_storage_get_host(storage);
+ msg_storage_priv_t storage_private = xbt_new0(s_msg_storage_priv_t, 1);
+ storage_private->host = host;
+ xbt_lib_set(storage_lib,name,MSG_STORAGE_LEVEL,storage_private);
+ return xbt_lib_get_elm_or_null(storage_lib, name);
+}
+
+/*
+ * \brief Destroys a storage (internal call only)
+ */
+void __MSG_storage_destroy(msg_storage_priv_t storage) {
+ free(storage);
+}
+
+
+/** \ingroup msg_storage_management
+ *
+ * \brief Returns the name of the #msg_storage_t.
+ *
+ * This functions checks whether a storage is a valid pointer or not and return its name.
+ */
+const char *MSG_storage_get_name(msg_storage_t storage) {
+ xbt_assert((storage != NULL), "Invalid parameters");
+ return SIMIX_storage_get_name(storage);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns the free space size of a storage element
+ * \param name the name of a storage
+ * \return the free space size of the storage element (as a #sg_size_t)
+ */
+sg_size_t MSG_storage_get_free_size(const char* name){
+ return simcall_storage_get_free_size(name);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns the used space size of a storage element
+ * \param name the name of a storage
+ * \return the used space size of the storage element (as a #sg_size_t)
+ */
+sg_size_t MSG_storage_get_used_size(const char* name){
+ return simcall_storage_get_used_size(name);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns a xbt_dict_t consisting of the list of properties assigned to this storage
+ * \param storage a storage
+ * \return a dict containing the properties
+ */
+xbt_dict_t MSG_storage_get_properties(msg_storage_t storage)