+2002-02-08 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * filetools.C (do_popen): fix for cygwin compatibility (from Claus
+ Hentschel). This code should maybe be moved to os:: class.
+
2002-02-08 Herbert Voss <voss@perce.de>
- * filetools.[C]: (unzipFile) fix typo
+ * filetools.C: (unzipFile) fix typo
2002-02-06 Herbert Voss <voss@perce.de>
- * filetools.[Ch]: fix sume bugs for detecting zipped files
+ * filetools.[Ch]: fix some bugs for detecting zipped files
adding unzipFile()
2002-02-04 Herbert Voss <voss@perce.de>
// of course the best would be to have a
// pstream (process stream), with the
// variants ipstream, opstream
- FILE * inf = ::popen(cmd.c_str(), "r");
+
+ // CYGWIN needs 'b', but linux only works without it
+#ifdef __CYGWIN__
+ FILE * inf = ::popen(cmd.c_str(), "rb");
+#else
+ FILE * inf = ::popen(cmd.c_str(), "r");
+#endif
+
+ // (Claus Hentschel) Check if popen was succesful ;-)
+ if (!inf)
+ return make_pair(-1, string());
+
string ret;
int c = fgetc(inf);
while (c != EOF) {