The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: KeepingRealBusy on December 30, 2010, 10:44:38 PM

Title: Windows sort.exe maximum string length.
Post by: KeepingRealBusy on December 30, 2010, 10:44:38 PM
I just ran into an interesting fact, sort.exe will not accept a string that is 65535 characters long, even if it is executed with the "REC 65535" option. It will accept a string that is 65535 characters long with the "REC 65535" option, so sort.exe must be counting the CRLF as part of the record.

Since Windows supports Unicode path names up to 32767 TChars (65534 BYTES), does that also mean that the 32767 count must include the terminating CRLF, thus the path itself must be only 32766 TChars long?
Title: Re: Windows sort.exe maximum string length.
Post by: hutch-- on December 31, 2010, 12:14:07 AM
That is probably so but its not a big deal to roll your own. Tokenise the string in place then sort it and write it back to a file.