Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Removes MSG_storage_file_rename()
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Mon, 24 Mar 2014 10:41:45 +0000 (11:41 +0100)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Mon, 24 Mar 2014 10:41:45 +0000 (11:41 +0100)
Implements MSG_file_move()

21 files changed:
examples/msg/io/storage.c
examples/msg/io/storage.tesh
include/msg/msg.h
include/simgrid/simix.h
src/include/surf/surf.h
src/msg/msg_io.c
src/simix/simcalls.in
src/simix/simcalls_generated_args_getter_setter.h
src/simix/simcalls_generated_body.c
src/simix/simcalls_generated_case.c
src/simix/simcalls_generated_enum.h
src/simix/simcalls_generated_res_getter_setter.h
src/simix/simcalls_generated_string.c
src/simix/smx_io.c
src/simix/smx_io_private.h
src/simix/smx_user.c
src/surf/storage_interface.hpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
src/surf/workstation_interface.cpp
src/surf/workstation_interface.hpp

index 66a1fd4..afe1897 100644 (file)
@@ -81,15 +81,15 @@ static int host(int argc, char *argv[]){
   XBT_INFO("Write %llu bytes on %s", write, file_name);
   MSG_file_dump(file);
 
-  MSG_file_close(file);
-  free(file_name);
-
   storage_name = xbt_strdup("Disk4");
   storage = MSG_storage_get_by_name(storage_name);
 
   // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
-  XBT_INFO("*** Renaming '/tmp/data.txt' into '/tmp/simgrid.readme'");
-  MSG_storage_file_rename(storage, "/tmp/data.txt", "/tmp/simgrid.readme");
+  XBT_INFO("*** Move '/tmp/data.txt' into '/tmp/simgrid.readme'");
+  MSG_file_move(file, "/home/tmp/simgrid.readme");
+
+  MSG_file_close(file);
+  free(file_name);
 
   // Now attach some user data to disk1
   XBT_INFO("*** Get/set data for storage element: %s ***",storage_name);
index e0e74b2..f3512c0 100644 (file)
@@ -29,7 +29,7 @@ $ ${bindir:=.}/io/storage ${srcdir:=.}/examples/platforms/storage.xml "--log=roo
 >              Storage Id: 'Disk4'
 >              Storage Type: 'single_SSD'
 >              Content Type: 'txt_unix'
-> [  0.007917] (1:(null)@denise) *** Renaming '/tmp/data.txt' into '/tmp/simgrid.readme'
+> [  0.007917] (1:(null)@denise) *** Move '/tmp/data.txt' into '/tmp/simgrid.readme'
 > [  0.007917] (1:(null)@denise) *** Get/set data for storage element: Disk4 ***
 > [  0.007917] (1:(null)@denise) Get data: '(null)'
 > [  0.007917] (1:(null)@denise) Set and get data: 'Some user data'
index cf6e52b..f7f04a3 100644 (file)
@@ -96,6 +96,7 @@ XBT_PUBLIC(sg_size_t) MSG_file_tell (msg_file_t fd);
 XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd);
 XBT_PUBLIC(void) __MSG_file_priv_free(msg_file_priv_t priv);
 XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t storage);
+XBT_PUBLIC(msg_error_t) MSG_file_move(msg_file_t fd, const char* fullpath);
 /************************** Storage handling ***********************************/
 XBT_PUBLIC(msg_host_t) MSG_get_storage_by_name(const char *name);
 XBT_PUBLIC(const char *) MSG_storage_get_name(msg_storage_t storage);
@@ -110,7 +111,6 @@ XBT_PUBLIC(void *) MSG_storage_get_data(msg_storage_t storage);
 XBT_PUBLIC(xbt_dict_t) MSG_storage_get_content(msg_storage_t storage);
 XBT_PUBLIC(sg_size_t) MSG_storage_get_size(msg_storage_t storage);
 XBT_PUBLIC(msg_error_t) MSG_storage_file_move(msg_file_t fd, msg_host_t dest, char* mount, char* fullname);
-XBT_PUBLIC(msg_error_t) MSG_storage_file_rename(msg_storage_t storage, const char* src,  const char* dest);
 XBT_PUBLIC(const char *) MSG_storage_get_host(msg_storage_t storage);
 /************************** AS Router handling ************************************/
 XBT_PUBLIC(const char *) MSG_as_router_get_property_value(const char* asr, const char *name);
index 6114538..fb02698 100644 (file)
@@ -498,6 +498,7 @@ XBT_PUBLIC(sg_size_t) simcall_file_get_size(smx_file_t fd);
 XBT_PUBLIC(xbt_dynar_t) simcall_file_get_info(smx_file_t fd);
 XBT_PUBLIC(sg_size_t) simcall_file_tell(smx_file_t fd);
 XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_size_t offset, int origin);
+XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath);
 /*****************************   Storage   **********************************/
 XBT_PUBLIC(sg_size_t) simcall_storage_get_free_size (const char* name);
 XBT_PUBLIC(sg_size_t) simcall_storage_get_used_size (const char* name);
@@ -508,7 +509,6 @@ XBT_PUBLIC(xbt_dict_t) SIMIX_storage_get_content(smx_storage_t storage);
 XBT_PUBLIC(xbt_dict_t) simcall_storage_get_content(smx_storage_t storage);
 XBT_PUBLIC(const char*) SIMIX_storage_get_name(smx_storage_t storage);
 XBT_PUBLIC(sg_size_t) SIMIX_storage_get_size(smx_storage_t storage);
-XBT_PUBLIC(void) simcall_storage_file_rename(smx_storage_t storage, const char* src,  const char* dest);
 XBT_PUBLIC(const char*) SIMIX_storage_get_host(smx_storage_t storage);
 /************************** AS router   **********************************/
 XBT_PUBLIC(xbt_dict_t) SIMIX_asr_get_properties(const char *name);
index 87fb6aa..c388006 100644 (file)
@@ -694,6 +694,19 @@ XBT_PUBLIC(size_t) surf_workstation_get_size(surf_resource_t workstation, surf_f
  */
 XBT_PUBLIC(size_t) surf_workstation_file_tell(surf_resource_t workstation, surf_file_t fd);
 
+/**
+ * @brief Move a file to another location on the *same mount point*.
+ * @details [long description]
+ *
+ * @param workstation The surf workstation
+ * @param fd The file descriptor
+ * @param fullpath The new full path
+ * @param origin Position used as a reference for the offset
+ *
+ * @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
+ */
+XBT_PUBLIC(int) surf_workstation_file_move(surf_resource_t workstation, surf_file_t fd, const char* fullpath);
+
 /**
  * @brief Set the position indictator assiociated with the file descriptor to a new position
  * @details [long description]
@@ -709,6 +722,7 @@ XBT_PUBLIC(size_t) surf_workstation_file_tell(surf_resource_t workstation, surf_
  */
 XBT_PUBLIC(int) surf_workstation_file_seek(surf_resource_t workstation, surf_file_t fd, sg_size_t offset, int origin);
 
+
 /**
  * @brief [brief description]
  * @details [long description]
@@ -750,15 +764,6 @@ XBT_PUBLIC(xbt_dict_t) surf_storage_get_content(surf_resource_t resource);
  */
 XBT_PUBLIC(sg_size_t) surf_storage_get_size(surf_resource_t resource);
 
-/**
- * @brief Rename a path
- * 
- * @param resource The surf storage
- * @param src The old path
- * @param dest The new path
- */
-XBT_PUBLIC(void) surf_storage_rename(surf_resource_t resource, const char* src, const char* dest);
-
 /**
  * @brief Get the data associated to the action
  * 
index c7bbe8c..fbaf853 100644 (file)
@@ -242,8 +242,18 @@ const char *MSG_file_get_name(msg_file_t fd) {
   return priv->fullpath;
 }
 
+/**
+ * \ingroup msg_file_management
+ * \brief Move a file to another location on the *same mount point*.
+ *
+ */
+msg_error_t MSG_file_move (msg_file_t fd, const char* fullpath)
+{
+  msg_file_priv_t priv = MSG_file_priv(fd);
+  return simcall_file_move(priv->simdata->smx_file, fullpath);
+}
 
-/*
+/**
  * \brief Destroys a file (internal call only)
  */
 void __MSG_file_destroy(msg_file_priv_t file) {
@@ -269,7 +279,7 @@ msg_storage_t __MSG_storage_create(smx_storage_t storage)
   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) {
@@ -402,30 +412,6 @@ sg_size_t MSG_storage_get_size(msg_storage_t storage)
   return SIMIX_storage_get_size(storage);
 }
 
-/**
- * \ingroup msg_storage_management
- *
- * \brief Rename the file in the contents of its associated storage.
- */
-msg_error_t MSG_storage_file_rename(msg_storage_t storage, const char* src,  const char* dest)
-{
-  simcall_storage_file_rename(storage, src, dest);
-  return MSG_OK;
-}
-
-/**
- * \ingroup msg_storage_management
- * \brief Move a file to another location. Depending on the values of dest, dest, mount,
- * and fullname, this move can be local or remote and, within a host, on the same
- * mounted disk or between mounted disks.
- *
- */
-msg_error_t MSG_storage_file_move (msg_file_t fd, msg_host_t dest, char* mount, char* fullname)
-{
-  THROW_UNIMPLEMENTED;
-  return MSG_OK;
-}
-
 /** \ingroup msg_storage_management
  *
  * \brief Returns the host name the storage is attached to
index 59865c8..9c7a7db 100644 (file)
@@ -118,7 +118,7 @@ file_get_size True (sg_size_t) (fd, void*, smx_file_t)
 file_tell True (sg_size_t) (fd, void*, smx_file_t)
 file_seek True (int) (fd, void*, smx_file_t) (offset, sg_size_t) (origin, int)
 file_get_info True (void*, xbt_dynar_t) (fd, void*, smx_file_t)
-storage_file_rename True (void) (storage, void*, smx_storage_t) (src, const char*) (dest, const char*)
+file_move True (int) (fd, void*, smx_file_t) (fullpath, const char*)
 storage_get_free_size True (sg_size_t) (name, const char*)
 storage_get_used_size True (sg_size_t) (name, const char*)
 storage_get_properties True (void*, xbt_dict_t) (storage, void*, smx_storage_t)
index e76f174..55ba148 100644 (file)
@@ -1142,24 +1142,18 @@ static inline smx_file_t simcall_file_get_info__get__fd(smx_simcall_t simcall){
 static inline void simcall_file_get_info__set__fd(smx_simcall_t simcall, void* arg){
     simcall->args[0].dp = arg;
 }
-static inline smx_storage_t simcall_storage_file_rename__get__storage(smx_simcall_t simcall){
-  return (smx_storage_t) simcall->args[0].dp;
+static inline smx_file_t simcall_file_move__get__fd(smx_simcall_t simcall){
+  return (smx_file_t) simcall->args[0].dp;
 }
-static inline void simcall_storage_file_rename__set__storage(smx_simcall_t simcall, void* arg){
+static inline void simcall_file_move__set__fd(smx_simcall_t simcall, void* arg){
     simcall->args[0].dp = arg;
 }
-static inline const char* simcall_storage_file_rename__get__src(smx_simcall_t simcall){
+static inline const char* simcall_file_move__get__fullpath(smx_simcall_t simcall){
   return  simcall->args[1].cc;
 }
-static inline void simcall_storage_file_rename__set__src(smx_simcall_t simcall, const char* arg){
+static inline void simcall_file_move__set__fullpath(smx_simcall_t simcall, const char* arg){
     simcall->args[1].cc = arg;
 }
-static inline const char* simcall_storage_file_rename__get__dest(smx_simcall_t simcall){
-  return  simcall->args[2].cc;
-}
-static inline void simcall_storage_file_rename__set__dest(smx_simcall_t simcall, const char* arg){
-    simcall->args[2].cc = arg;
-}
 static inline const char* simcall_storage_get_free_size__get__name(smx_simcall_t simcall){
   return  simcall->args[0].cc;
 }
index c37a78b..5e2bf9e 100644 (file)
     }    
     return self->simcall.result.dp;
   }
-  inline static void simcall_BODY_storage_file_rename(smx_storage_t storage, const char* src, const char* dest) {
+  inline static int simcall_BODY_file_move(smx_file_t fd, const char* fullpath) {
     smx_process_t self = SIMIX_process_self();
-    self->simcall.call = SIMCALL_STORAGE_FILE_RENAME;
+    self->simcall.call = SIMCALL_FILE_MOVE;
     memset(&self->simcall.result, 0, sizeof(self->simcall.result));
     memset(self->simcall.args, 0, sizeof(self->simcall.args));
-    self->simcall.args[0].dp = (void*) storage;
-    self->simcall.args[1].cc = (const char*) src;
-    self->simcall.args[2].cc = (const char*) dest;
+    self->simcall.args[0].dp = (void*) fd;
+    self->simcall.args[1].cc = (const char*) fullpath;
     if (self != simix_global->maestro_process) {
       XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
                 SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
     } else {
       SIMIX_simcall_pre(&self->simcall, 0);
     }    
-    
+    return self->simcall.result.i;
   }
   inline static sg_size_t simcall_BODY_storage_get_free_size(const char* name) {
     smx_process_t self = SIMIX_process_self();
index cc672ef..6d7bc91 100644 (file)
@@ -546,8 +546,8 @@ case SIMCALL_FILE_GET_INFO:
       SIMIX_simcall_answer(simcall);
       break;  
 
-case SIMCALL_STORAGE_FILE_RENAME:
-       SIMIX_pre_storage_file_rename(simcall , (smx_storage_t) simcall->args[0].dp,  simcall->args[1].cc,  simcall->args[2].cc);
+case SIMCALL_FILE_MOVE:
+      simcall->result.i = SIMIX_pre_file_move(simcall , (smx_file_t) simcall->args[0].dp,  simcall->args[1].cc);
       SIMIX_simcall_answer(simcall);
       break;  
 
index f3a064e..448c05a 100644 (file)
@@ -117,7 +117,7 @@ SIMCALL_FILE_GET_SIZE,
 SIMCALL_FILE_TELL,
 SIMCALL_FILE_SEEK,
 SIMCALL_FILE_GET_INFO,
-SIMCALL_STORAGE_FILE_RENAME,
+SIMCALL_FILE_MOVE,
 SIMCALL_STORAGE_GET_FREE_SIZE,
 SIMCALL_STORAGE_GET_USED_SIZE,
 SIMCALL_STORAGE_GET_PROPERTIES,
index bcee194..052b1f4 100644 (file)
@@ -485,8 +485,12 @@ static inline xbt_dynar_t simcall_file_get_info__get__result(smx_simcall_t simca
 static inline void simcall_file_get_info__set__result(smx_simcall_t simcall, void* result){
     simcall->result.dp = result;
 }
-
-
+static inline int simcall_file_move__get__result(smx_simcall_t simcall){
+  return  simcall->result.i;
+}
+static inline void simcall_file_move__set__result(smx_simcall_t simcall, int result){
+    simcall->result.i = result;
+}
 static inline sg_size_t simcall_storage_get_free_size__get__result(smx_simcall_t simcall){
   return  simcall->result.sgsz;
 }
index ed629fa..0f14211 100644 (file)
 [SIMCALL_FILE_TELL] = "SIMCALL_FILE_TELL",
 [SIMCALL_FILE_SEEK] = "SIMCALL_FILE_SEEK",
 [SIMCALL_FILE_GET_INFO] = "SIMCALL_FILE_GET_INFO",
-[SIMCALL_STORAGE_FILE_RENAME] = "SIMCALL_STORAGE_FILE_RENAME",
+[SIMCALL_FILE_MOVE] = "SIMCALL_FILE_MOVE",
 [SIMCALL_STORAGE_GET_FREE_SIZE] = "SIMCALL_STORAGE_GET_FREE_SIZE",
 [SIMCALL_STORAGE_GET_USED_SIZE] = "SIMCALL_STORAGE_GET_USED_SIZE",
 [SIMCALL_STORAGE_GET_PROPERTIES] = "SIMCALL_STORAGE_GET_PROPERTIES",
index 5bfbe20..25c87cf 100644 (file)
@@ -290,14 +290,15 @@ int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int
   return  surf_workstation_file_seek(host, fd->surf_file, offset, origin);
 }
 
-void SIMIX_pre_storage_file_rename(smx_simcall_t simcall, smx_storage_t storage, const char* src, const char* dest)
+int SIMIX_pre_file_move(smx_simcall_t simcall, smx_file_t file, const char* fullpath)
 {
-  return SIMIX_storage_file_rename(simcall->issuer, storage, src, dest);
+  return SIMIX_file_move(simcall->issuer, file, fullpath);
 }
 
-void SIMIX_storage_file_rename(smx_process_t process, smx_storage_t storage, const char* src, const char* dest)
+int SIMIX_file_move(smx_process_t process, smx_file_t file, const char* fullpath)
 {
-  return  surf_storage_rename(storage, src, dest);
+  smx_host_t host = process->smx_host;
+  return  surf_workstation_file_move(host, file->surf_file, fullpath);
 }
 
 sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, const char* name)
index 860c9f6..8a3c38d 100644 (file)
@@ -33,8 +33,7 @@ sg_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
 sg_size_t SIMIX_pre_file_tell(smx_simcall_t simcall, smx_file_t fd);
 xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
 int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_size_t offset, int origin);
-void SIMIX_pre_storage_file_rename(smx_simcall_t simcall,smx_storage_t storage, const char* src, const char* dest);
-
+int SIMIX_pre_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
 smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size);
 smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* fullpath);
@@ -46,8 +45,8 @@ sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
 sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
 xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
 int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int origin);
+int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath);
 
-void SIMIX_storage_file_rename(smx_process_t process, smx_storage_t storage, const char* src, const char* dest);
 sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,const char* name);
 sg_size_t SIMIX_storage_get_free_size(smx_process_t process,const char* name);
 
index 61ffbfe..d4ecd2f 100644 (file)
@@ -1402,11 +1402,12 @@ int simcall_file_seek(smx_file_t fd, sg_size_t offset, int origin){
 
 /**
  * \ingroup simix_file_management
+ * \brief Move a file to another location on the *same mount point*.
  *
  */
-void simcall_storage_file_rename(smx_storage_t storage, const char* src,  const char* dest)
+int simcall_file_move(smx_file_t fd, const char* fullpath)
 {
-  return simcall_BODY_storage_file_rename(storage, src, dest);
+  return simcall_BODY_file_move(fd, fullpath);
 }
 
 /**
index d70771c..c63d044 100644 (file)
@@ -219,14 +219,6 @@ public:
    */
   virtual StorageActionPtr write(surf_file_t fd, sg_size_t size)=0;
 
-  /**
-   * @brief Rename a path
-   * 
-   * @param src The old path
-   * @param dest The new path
-   */
-  virtual void rename(const char *src, const char *dest)=0;
-
   /**
    * @brief Get the content of the current Storage
    * 
index cfe41f8..5944409 100644 (file)
@@ -484,21 +484,6 @@ StorageActionPtr StorageN11::write(surf_file_t fd, sg_size_t size)
   return action;
 }
 
-void StorageN11::rename(const char *src, const char *dest)
-{
-  sg_size_t *psize, *new_psize;
-  psize = (sg_size_t*) xbt_dict_get_or_null(p_content,src);
-  new_psize = xbt_new(sg_size_t, 1);
-  *new_psize = *psize;
-  if (psize){// src file exists
-    xbt_dict_remove(p_content, src);
-    xbt_dict_set(p_content, dest, new_psize,NULL);
-    XBT_DEBUG("Change file name from %s to %s, size '%llu'",src, dest, *psize);
-  }
-  else
-    XBT_DEBUG("File %s doesn't exist",src);
-}
-
 /**********
  * Action *
  **********/
index c432691..82e93b1 100644 (file)
@@ -408,6 +408,10 @@ int surf_workstation_file_seek(surf_resource_t workstation, surf_file_t fd, sg_s
   return get_casted_workstation(workstation)->fileSeek(fd, offset, origin);
 }
 
+int surf_workstation_file_move(surf_resource_t workstation, surf_file_t fd, const char* fullpath){
+  return get_casted_workstation(workstation)->fileMove(fd, fullpath);
+}
+
 xbt_dynar_t surf_workstation_get_vms(surf_resource_t resource){
   return get_casted_workstation(resource)->getVms();
 }
@@ -480,10 +484,6 @@ const char* surf_storage_get_host(surf_resource_t resource){
   return static_cast<StoragePtr>(surf_storage_resource_priv(resource))->p_attach;
 }
 
-void surf_storage_rename(surf_resource_t resource, const char* src, const char* dest){
-  static_cast<StoragePtr>(surf_storage_resource_priv(resource))->rename(src, dest);
-}
-
 surf_action_t surf_cpu_execute(surf_resource_t cpu, double size){
   return get_casted_cpu(cpu)->execute(size);
 }
index 63c4219..60480b9 100644 (file)
@@ -337,6 +337,37 @@ int Workstation::fileSeek(surf_file_t fd, sg_size_t offset, int origin){
   }
 }
 
+int Workstation::fileMove(surf_file_t fd, const char* fullpath){
+
+  /* Check if the new full path is on the same mount point */
+  if(!strncmp((const char*)fd->mount, fullpath, strlen(fd->mount)))
+  {
+    sg_size_t *psize, *new_psize;
+    psize = (sg_size_t*) xbt_dict_get_or_null(findStorageOnMountList(fd->mount)->p_content,fd->name);
+    new_psize = xbt_new(sg_size_t, 1);
+    *new_psize = *psize;
+    if (psize){// src file exists
+         xbt_dict_remove(findStorageOnMountList(fd->mount)->p_content, fd->name);
+
+         char *path = (char *) xbt_malloc ((strlen(fullpath)-strlen(fd->mount)+1));;
+         strncpy(path, fullpath+strlen(fd->mount), strlen(fullpath)-strlen(fd->mount)+1);
+         xbt_dict_set(findStorageOnMountList(fd->mount)->p_content, path, new_psize,NULL);
+         XBT_DEBUG("Move file from %s to %s, size '%llu'",fd->name, fullpath, *psize);
+         free(path);
+         return MSG_OK;
+    }
+    else
+         XBT_WARN("File %s doesn't exist", fd->name);
+      return MSG_TASK_CANCELED;
+    }
+  else
+  {
+       XBT_WARN("New full path %s is not on the same mount point: %s. Action has been canceled.", fullpath, fd->mount);
+       return MSG_TASK_CANCELED;
+  }
+}
+
+
 sg_size_t Workstation::getFreeSize(const char* name)
 {
   StoragePtr st = findStorageOnMountList(name);
index 0b59b94..473b044 100644 (file)
@@ -369,6 +369,17 @@ public:
    */
   virtual int fileSeek(surf_file_t fd, sg_size_t offset, int origin);
 
+  /**
+   * @brief Move a file to another location on the *same mount point*.
+   * @details [long description]
+   *
+   * @param fd The file descriptor
+   * @param fullpath The new full path
+   * @return MSG_OK if successful, MSG_TASK_CANCELED and a warning if the new
+   * full path is not on the same mount point
+   */
+  virtual int fileMove(surf_file_t fd, const char* fullpath);
+
   xbt_dynar_t p_storage;
   RoutingEdgePtr p_netElm;
   CpuPtr p_cpu;