Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do truncate files before writting into it (gras file sockets are streams, seeking...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 11 Oct 2007 06:22:35 +0000 (06:22 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 11 Oct 2007 06:22:35 +0000 (06:22 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4805 48e7efb5-ca39-0410-a469-dd3cf9ba447f

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,