Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do truncate files before writting into it (gras file sockets are streams, seeking...
[simgrid.git] / src / gras / Transport / transport_plugin_file.c
index 9ad44a7..7b20968 100644 (file)
@@ -84,7 +84,7 @@ gras_socket_client_from_file(const char*path) {
   res->plugin=gras_trp_plugin_get_by_name("file");
 
   if (strcmp("-", path)) {
-    res->sd = open(path, O_WRONLY|O_CREAT | O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP );
+    res->sd = open(path, O_TRUNC|O_WRONLY|O_CREAT | O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP );
     
     if ( res->sd < 0) {
       THROW2(system_error,0,