This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

1.5.10: bug in /usr/sbin/strfile


I know that problems with strfile have been reported before, but looking through the list archive I haven't seen a clear statement of the problem nor any responses that deal with the problem.

The symptoms: If I run strfile on a file of quotes to generate a .dat file for the fortune program, I get strange behaviour from fortune for that quote file. I either get blank fortunes, or sometimes just the same quote again and again. I tried this with the latest stable release of Cygwin (1.5.10) but its been around for a long time.

I suspect that this is another example of an old problem with Unix programs ported to Windows. I mount my disks in text mode so that for text files (but not binary files) \n gets translated to DOS line-ends. This option tends to show up bugs in Unix programs where binary files are opened incorrectly in text mode. This is a common bug because on Unix there is no difference between text and binary modes.

So I tried adding a new mount point:

D:\cygwin\usr\share\fortune on /usr/share/fortune type system (binmode)

This makes just the fortune quote files' directory binary mode - i.e. no text file conversions.

Sure enough, strfile now creates .dat files that fortune likes.

Okay, having a special mount point is a bodge. It does however show that my suspicions are probably correct. I suspect that somewhere in strfile's source is an fopen with the mode "w" instead of "wb" when the .dat file is created. However, I don't know who's responsible for this program - so I thought I'd post my conclusions here. Is there anyone out there who knows how to get this fixed?

Andy

--
Andy Rushton, Southampton, UK

If all these sweet young things were laid end-to-end, I wouldn't be a
bit surprised.
		-- Dorothy Parker


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]