Paul Prescod wrote: > Maybe the guessing algorithm should read the WHOLE FILE. That wouldn't work for streams (e.g. stdin). The algorithm I gave does work for streams, provided that they have a push-back buffer of at least 4 bytes. -- David Hopwood <david.nospam.hopwood at blueyonder.co.uk>