- char *name;
- msg_file_priv_t priv = xbt_new(s_msg_file_priv_t, 1);
- priv->data = data;
- priv->fullpath = xbt_strdup(fullpath);
- priv->simdata = xbt_new0(s_simdata_file_t,1);
- priv->simdata->smx_file = simcall_file_open(fullpath, MSG_host_self());
- priv->desc_id = __MSG_host_get_file_descriptor_id(MSG_host_self());
-
- name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_get_name(MSG_host_self()),
- priv->desc_id);
-
- xbt_lib_set(file_lib, name, MSG_FILE_LEVEL, priv);
- msg_file_t fd = (msg_file_t) xbt_lib_get_elm_or_null(file_lib, name);
- __MSG_file_get_info(fd);
- xbt_free(name);
-
+ msg_file_t fd = new simgrid::s4u::File(fullpath, MSG_host_self());
+ fd->desc_id = MSG_host_get_file_descriptor_id(MSG_host_self());