Lars Gullik Bjønnes wrote: >>> On Feb 16, 2005, at 1:38 PM, Angus Leeming wrote: >>> >>>> Just to be crystal clear: does it work if you change >>>> - ifstream ifs(from.c_str(), ios::binary); >>>> + ifstream ifs(from.c_str()); >>> >>> Yes. (As does LyX when I make that change in copy.C.) >> > | Then since Windows caused the bother here, I suggest modifying the LyX > | code to read > > Have "ios::in | ios::binary" been tried?
Ok, ok. Bennett, can you try ifstream ifs(from.c_str(), ios::in | ios::binary); > | bool lyx_copy(string const & from, string const & to) > | { > | +#if defined (WIN32) > | ifstream ifs(from.c_str(), ios::binary); > | +#else > | + // A bug in the gcc 2.95 implementation of ifstream > | + // means that we can't use ios::binary here (even though > | + // it should have no effect on unix machines). > | + ifstream ifs(from.c_str()); > | +#endif > > I don't like this ... If at all... only the failing compiler/stdlib > should have special code. Sheesh! With all due respect, why do you care? The flag should have absolutely no effect on a unix machine, so the two pieces are exactly equivalent to a compliant compiler/lib. Nonetheless, to show willing: #if defined (__GNUC__) && defined (__GNUC_MINOR__) && \ !defined(_STLPORT_VERSION) && \ __GNUC__ == 2 && __GNUC_MINOR__ <= 95 Do you really want that? -- Angus