Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fp => fd (for file descriptor)
[simgrid.git] / src / msg / msg_io.c
index 008c7bf..a61f4b1 100644 (file)
@@ -76,15 +76,15 @@ msg_file_t MSG_file_open(const char* mount, const char* path, const char* mode)
 /** \ingroup msg_file_management
  * \brief Close the file
  *
- * \param fp is the file to close
+ * \param fd is the file to close
  * \return 0 on success or 1 on error
  */
-int MSG_file_close(msg_file_t fp)
+int MSG_file_close(msg_file_t fd)
 {
-  int res = simcall_file_close(fp->simdata->smx_file);
-  free(fp->name);
-  xbt_free(fp->simdata);
-  xbt_free(fp);
+  int res = simcall_file_close(fd->simdata->smx_file);
+  free(fd->name);
+  xbt_free(fd->simdata);
+  xbt_free(fd);
   return res;
 }
 
@@ -103,6 +103,18 @@ int MSG_file_unlink(msg_file_t fd)
   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 size_t)
+ */
+
+size_t MSG_file_get_size(msg_file_t fd){
+  size_t size = simcall_file_get_size(fd->simdata->smx_file);
+  return size;
+}
+
 /** \ingroup msg_file_management
  * \brief Search for file
  *