Bug 46931

GemStone/S

6.7.2.1, 6.7.2, 6.7.1, 6.7, 6.6.5, 6.6.4, 6.6.3.3, 6.6.3.2, 6.6.3, 6.5.8, 6.5.7.5, 6.5.7, 6.3.1, 6.1.6, 6.1.5

Windows only

Problems reading Unix-formatted text files on Windows

Unix-formatted text files using just the single line-feed character as a line separator cannot be properly read using GsFile.  There are problems with the underlying Windows OS call used to retrieve position, which will in turn cause incorrect results for other GsFile reading methods (position, atEnd, next*).

Workaround

1.  Convert the Unix-formatted file into a standard Windows format using a utility such as unix2dos.

2.  Open the file in binary mode.  For example:

file := GsFile open: 'filename' mode: 'rb'.

Note that if you open a Windows-formatted text file in binary mode you'll get separate CR and LF characters on subsequent #next calls rather than a single LF.


                

Last updated: 6/8/17