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|O_EXCL;
+#else
+ fdflags = O_WRONLY|O_CREAT|O_EXCL;
+#endif
if (force_overwrite == 0) {
fdflags |= O_EXCL;
}