Table of Contents
Previous Go to Robert Ramey Software Development Home Page next

6. Postman's Sort for Windows/NT/95

The Postman's Sort Developer's Kit includes two versions for Windows/NT and Windows/95. The first console mode version PSORTNT which functions in all respects like the other console mode versions for DOS, UNIX, and OS/2. Input and output can be piped from/to other programs running simultaneously via the command line pipe mechanism. This provides a simple and effective way to filter records before and after sorting.

Also is included is the the program PSORTWNT. This is a true windows program built with the PSORTNT Dynamic link library. Source for PSORTWNT is included to illustrate how the PSORTNT.DLL is used and to serve as a basis for developing custom windows applications which can perform fast sorting of large files. PSORTWNT can be launched from program manager or from the Win/95 desktop just by filling the command line in the properties of the PSORTWNT icon and double clicking.

Both of these versions can be run on 16 bit versions of the Windows operating system if the Win32s subsystem has been previously installed. However, the following should be considered when executing PSORTWNT on Windows 3.1 with the Win32s subsystem installed:

a) Only one instance of PSORTWNT should execute at time.

b) The -m switch must be used to sort files whose size exceeds that of memory. This is due to the fact the Win32s implementation of the Windows/NT API call used to determine true physical memory doesn't return the correct value. Until this is corrected by Microsoft the -m switch must be used to indicate the maximum amount of memory that should be allocated by the Postman's Sort. Use of virtual memory for sorting will almost always result in extremely long sorting times.

c) It seems that the Win32s system consumes a significant amount of memory. PSORTWNT.EXE works best on systems with RAM of 8MB or more.

d) The console application PSORTNT will execute but can only be launched from the program manager. It cannot be launched from the DOS command line. Also, error messages which are normally written to the console are lost, so there will be no indication should the sorting task fail to complete.