From: mquinson Date: Thu, 11 Oct 2007 06:22:35 +0000 (+0000) Subject: Do truncate files before writting into it (gras file sockets are streams, seeking... X-Git-Tag: v3.3~986 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/725b49dcb59d91cbf1f29ab74e7992748eb1df06 Do truncate files before writting into it (gras file sockets are streams, seeking into it to change only subparts is a non-sense) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4805 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Transport/transport_plugin_file.c b/src/gras/Transport/transport_plugin_file.c index 9ad44a7dad..7b209682c8 100644 --- a/src/gras/Transport/transport_plugin_file.c +++ b/src/gras/Transport/transport_plugin_file.c @@ -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,