XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg, "Logging specific to MSG (io)");
-/** @addtogroup msg_file_management
- * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
+/** @addtogroup msg_file
* (#msg_file_t) and the functions for managing it.
*
* \see #msg_file_t
xbt_dynar_free_container(&info);
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
*
* \brief Set the user data of a #msg_file_t.
*
return MSG_OK;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
*
* \brief Return the user data of a #msg_file_t.
*
return priv->data;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Display information related to a file descriptor
*
* \param fd is a the file descriptor
priv->content_type, priv->desc_id);
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Read a file (local or remote)
*
* \param size of the file to read
return read_size;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Write into a file (local or remote)
*
* \param size of the file to write
sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
{
msg_file_priv_t file_priv = MSG_file_priv(fd);
- sg_size_t write_size, offset;
/* Find the host where the file is physically located (remote or local)*/
msg_storage_t storage_src =(msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, file_priv->storageId);
}
}
/* Write file on local or remote host */
- offset = simcall_file_tell(file_priv->simdata->smx_file);
- write_size = simcall_file_write(file_priv->simdata->smx_file, size, attached_host);
+ sg_size_t offset = simcall_file_tell(file_priv->simdata->smx_file);
+ sg_size_t write_size = simcall_file_write(file_priv->simdata->smx_file, size, attached_host);
file_priv->size = offset+write_size;
return write_size;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Opens the file whose name is the string pointed to by path
*
* \param fullpath is the file location on the storage
return fd;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Close the file
*
* \param fd is the file to close
return res;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Unlink the file pointed by fd
*
* \param fd is the file descriptor (#msg_file_t)
return (msg_error_t) res;
}
-/** \ingroup msg_file_management
+/** \ingroup msg_file
* \brief Return the size of a file
*
* \param fd is the file descriptor (#msg_file_t)
}
/**
- * \ingroup msg_file_management
+ * \ingroup msg_file
* \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).
*
}
/**
- * \ingroup msg_file_management
+ * \ingroup msg_file
* \brief Returns the current value of the position indicator of the file
*
* \param fd : file object that identifies the stream
}
/**
- * \ingroup msg_file_management
+ * \ingroup msg_file
* \brief Move a file to another location on the *same mount point*.
*
*/
}
/**
- * \ingroup msg_file_management
+ * \ingroup msg_file
* \brief Copy a file to another location on a remote host.
* \param file : the file to move
* \param host : the remote host where the file has to be copied
/* Find the real host destination where the file will be physically stored */
xbt_dict_cursor_t cursor = NULL;
- char *mount_name, *storage_name, *file_mount_name, *host_name_dest;
msg_storage_t storage_dest = NULL;
msg_host_t host_dest;
size_t longest_prefix_length = 0;
xbt_dict_t storage_list = host->mountedStoragesAsDict();
+ char *mount_name, *storage_name;
xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
- file_mount_name = (char *) xbt_malloc ((strlen(mount_name)+1));
+ char* file_mount_name = (char *) xbt_malloc ((strlen(mount_name)+1));
strncpy(file_mount_name,fullpath,strlen(mount_name)+1);
file_mount_name[strlen(mount_name)] = '\0';
}
xbt_dict_free(&storage_list);
+ char* host_name_dest = nullptr;
if(longest_prefix_length>0){
/* Mount point found, retrieve the host the storage is attached to */
msg_storage_priv_t storage_dest_priv = MSG_storage_priv(storage_dest);
host_name_dest = (char*)storage_dest_priv->hostname;
host_dest = MSG_host_by_name(host_name_dest);
-
}else{
XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, sg_host_get_name(host));
return MSG_TASK_CANCELED;
}
/**
- * \ingroup msg_file_management
+ * \ingroup msg_file
* \brief Move a file to another location on a remote host.
* \param file : the file to move
* \param host : the remote host where the file has to be moved
/********************************* Storage **************************************/
/** @addtogroup msg_storage_management
- * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Storages" --> \endhtmlonly
* (#msg_storage_t) and the functions for managing it.
*/