+//SIMIX FILE UNLINK
+void SIMIX_pre_file_unlink(smx_simcall_t simcall, smx_file_t fd)
+{
+ smx_action_t action = SIMIX_file_unlink(simcall->issuer, fd);
+ xbt_fifo_push(action->simcalls, simcall);
+ simcall->issuer->waiting_action = action;
+}
+
+smx_action_t SIMIX_file_unlink(smx_process_t process, smx_file_t fd)
+{
+ smx_action_t action;
+ smx_host_t host = process->smx_host;
+ /* check if the host is active */
+ if (surf_workstation_model->extension.
+ workstation.get_state(host) != SURF_RESOURCE_ON) {
+ THROWF(host_error, 0, "Host %s failed, you cannot call this function",
+ sg_host_name(host));
+ }
+
+ action = xbt_mallocator_get(simix_global->action_mallocator);
+ action->type = SIMIX_ACTION_IO;
+ action->name = NULL;
+#ifdef HAVE_TRACING
+ action->category = NULL;
+#endif
+
+ action->io.host = host;
+ action->io.surf_io = surf_workstation_model->extension.workstation.unlink(host, fd->surf_file);
+
+ surf_workstation_model->action_data_set(action->io.surf_io, action);
+ XBT_DEBUG("Create io action %p", action);
+
+ return action;
+}
+
+//SIMIX FILE LS
+void SIMIX_pre_file_ls(smx_simcall_t simcall,
+ const char* mount, const char* path)
+{
+ smx_action_t action = SIMIX_file_ls(simcall->issuer, mount, path);
+ xbt_fifo_push(action->simcalls, simcall);
+ simcall->issuer->waiting_action = action;
+}
+smx_action_t SIMIX_file_ls(smx_process_t process, const char* mount, const char *path)
+{
+ smx_action_t action;
+ smx_host_t host = process->smx_host;
+ /* check if the host is active */
+ if (surf_workstation_model->extension.workstation.get_state(host) != SURF_RESOURCE_ON) {
+ THROWF(host_error, 0, "Host %s failed, you cannot call this function",
+ sg_host_name(host));
+ }
+
+ action = xbt_mallocator_get(simix_global->action_mallocator);
+ action->type = SIMIX_ACTION_IO;
+ action->name = NULL;
+#ifdef HAVE_TRACING
+ action->category = NULL;
+#endif
+
+ action->io.host = host;
+ action->io.surf_io = surf_workstation_model->extension.workstation.ls(host,mount,path);
+
+ surf_workstation_model->action_data_set(action->io.surf_io, action);
+ XBT_DEBUG("Create io action %p", action);
+ return action;
+}
+
+static void free_file_stat(void *p)
+{
+ file_stat_t fs = p;
+ xbt_free(fs->date);
+ xbt_free(fs->group);
+ xbt_free(fs->time);
+ xbt_free(fs->user);
+ xbt_free(fs->user_rights);
+ xbt_free(fs);
+}
+