Hello,<div><br></div><div>While working on more of the 'for' processing in the command shell, I've come across a stumbling block that wildcard expansion 'ordering' is not guaranteed (findfirst/findnext) meaning I cannot automate tests for some of the key bits - this is frustrating as we really need tests for the things I'm looking at as the code is getting complex. Looking in the cmd testsuite, there's already some commented out tests as well, saying we really need a 'sort' implementation, and that would also resolve the problem I have at the moment. </div>
<div><br></div><div>Therefore, I'd like to know if there's any simple way to implement a command line sort program which we can call from the command shell.  This has subsequently been raised as bug 27933.</div><div>
<br></div><div>My first thought was to avoid reinventing the wheel and to have a windows program called sort which parses its parameters and then runs the Unix 'sort' command with an equivalent command line. I think most of the windows command line parameters have Unix equivalents, and for the majority of cases it would be a case of transposing a windows path to a Unix path, and just running the Unix sort.</div>
<div><br></div><div>However, I then started to get concerned about stdin / stdout... Is there any way to take the windows stdin and 'connect it' to the unix program you spawn, and vica-versa for the stdout. Whilst I dont accurately need this for the testsuite, without it the wine implementation would not match the windows one. </div>
<div><br></div><div>So I think my specific questions are...</div><div><br></div><div>1. Is wrappering an existing (Linux) 'sort' program an option for this, or do we really need a whole unique implementation of sort (which I would have no idea how to write!)?</div>
<div><br></div><div>If it is an option, the two key questions I have are:</div><div><br></div><div>2. How do I handle stdin / stdout, so sort can work in pipes / redirects</div><div><br></div><div>3. Is it ok to use wine_get_unix_file_name to convert files and directories to the unix equivalents when building the unix equivalent command line? (as per winepath)</div>
<div><br></div><div>Thanks.</div><div>Jason</div>