/*****************************************************************************
- * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2002
+ * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2004
*****************************************************************************
* rrd_restore.c creates new rrd from data dumped by rrd_dump.c
*****************************************************************************/
if (strcmp("-",file_name)==0){
rrd_file= stdout;
} else {
- fdflags = O_WRONLY|O_CREAT|O_BINARY|O_EXCL;
+#ifdef WIN32
+ fdflags = O_RDWR|O_BINARY|O_CREAT;
+#else
+ fdflags = O_WRONLY|O_CREAT;
+#endif
if (force_overwrite == 0) {
fdflags |= O_EXCL;
}