[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    'sort' implementation (Bug 27933) - any easy way?
From:       Ann and Jason Edmeades <jason () edmeades ! me ! uk>
Date:       2012-09-27 14:40:05
Message-ID: CAEVjaAFYg+4_w-OMeFCDBh-Vpuhm2yL4bXz8bB0bhjoX8WjifQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

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.

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.

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.

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.

So I think my specific questions are...

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!)?

If it is an option, the two key questions I have are:

2. How do I handle stdin / stdout, so sort can work in pipes / redirects

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)

Thanks.
Jason

[Attachment #5 (text/html)]

Hello,<div><br></div><div>While working on more of the &#39;for&#39; proces=
sing in the command shell, I&#39;ve come across a stumbling block that wild=
card expansion &#39;ordering&#39; is not guaranteed (findfirst/findnext) me=
aning I cannot automate tests for some of the key bits - this is frustratin=
g as we really need tests for the things I&#39;m looking at as the code is =
getting complex.=A0Looking in the cmd testsuite, there&#39;s already some c=
ommented out tests as well, saying we really need a &#39;sort&#39; implemen=
tation, and that would also resolve the problem I have at the moment.=A0</d=
iv>
<div><br></div><div>Therefore, I&#39;d like to know if there&#39;s any simp=
le way to implement a command line sort program which we can call from the =
command shell. =A0This has subsequently been raised as bug 27933.</div><div=
>
<br></div><div>My first thought was to avoid reinventing the wheel and to h=
ave a windows program called sort which parses its parameters and then runs=
 the Unix &#39;sort&#39; command with an=A0equivalent=A0command line. I thi=
nk most of the windows command line parameters have Unix equivalents, and f=
or the majority of cases it would be a case of transposing a windows path t=
o a=A0Unix=A0path, and just running the=A0Unix=A0sort.</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 &#39;connect it&#3=
9; to the unix program you spawn, and vica-versa for the stdout. Whilst I d=
ont accurately need this for the testsuite, without it the wine implementat=
ion would not match the windows one.=A0</div>
<div><br></div><div>So I think my specific questions are...</div><div><br><=
/div><div>1. Is wrappering an existing (Linux) &#39;sort&#39; program an op=
tion 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=A0wine_ge=
t_unix_file_name to convert files and directories to the unix equivalents w=
hen building the unix equivalent command line? (as per winepath)</div>
<div><br></div><div>Thanks.</div><div>Jason</div>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic