[Bug 21227] New: cmd doesn't echo redirection like native
http://bugs.winehq.org/show_bug.cgi?id=21227 Summary: cmd doesn't echo redirection like native Product: Wine Version: 1.1.35 Platform: x86 OS/Version: Linux Status: NEW Keywords: download, source, testcase Severity: normal Priority: P3 Component: programs AssignedTo: wine-bugs(a)winehq.org ReportedBy: dank(a)kegel.com Native cmd echoes commands after some canonicalization has been done on their redirects. A batch file containing dir 1> ok dir > bad dir | bad dir > blah > bad echoes as dir 1> ok dir 1> bad dir | bad dir 1> bad (note the extra space inserted before the > or |). Wine's cmd doesn't currently do this, but it could probably do so without too much trouble; it already collects redirects separately for each command. For the moment I'll probably put a kludge in the cmd conformance test runner to compensate. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 Dan Kegel <dank(a)kegel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|programs |cmd -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 Jason Edmeades <us(a)edmeades.me.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |us(a)edmeades.me.uk --- Comment #1 from Jason Edmeades <us(a)edmeades.me.uk> 2010-01-06 18:26:43 --- Adding myself to the cmd bugs -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 Frédéric Delanoy <frederic.delanoy(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic.delanoy(a)gmail.com --- Comment #2 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-05-30 08:00:02 CDT --- (In reply to comment #0)
dir | bad This line fails on Windows: 'bad' is not recognized as an internal or external command, operable program or batch file.
Is it intended? I have different results: for me, w2k returns (command prompts omitted) dir 1>ok dir 1>bad dir | bad (with the error message) (no output for dir > blah > bad) If I create a bat file with "dir > blah > bad" as sole line, I get dir 1>bad -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #3 from Dan Kegel <dank(a)kegel.com> 2011-05-30 10:40:43 CDT --- "dir | bad" was probably a brain fart. Hey, in wine, if I do dir > blah > bad type blah I get a sharing violation! I bet cmd leaks a file handle there. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #4 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-06-04 02:30:09 CDT --- (In reply to comment #3)
"dir | bad" was probably a brain fart.
Hey, in wine, if I do dir > blah > bad type blah I get a sharing violation! I bet cmd leaks a file handle there.
In wine-1.3.21(and -159-ge398b93), I get different results: dir 1> ok dir > bad dir > blah > bad (but no sharing violation when "type"ing) w2k gives dir 1>ok dir 1>bad dir 1>bad -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #5 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-07-14 10:04:56 CDT --- (In reply to comment #3)
"dir | bad" was probably a brain fart.
Hey, in wine, if I do dir > blah > bad type blah I get a sharing violation! I bet cmd leaks a file handle there.
Actually I get one as well. Another problem with redirections I encounter is echo foo2>> fooT sets "foo" in "fooT", but that's probably because >> is not supported. cmd should probably err in that case, though. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #6 from Frédéric Delanoy <frederic.delanoy(a)gmail.com> 2011-07-14 10:58:13 CDT --- (In reply to comment #3)
"dir | bad" was probably a brain fart.
Hey, in wine, if I do dir > blah > bad type blah I get a sharing violation! I bet cmd leaks a file handle there.
Would you mind creating a bug for this? I bet not all redirection problems will be fixed in this bug ;) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 Myk Taylor <myk002(a)yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |myk002(a)yahoo.com --- Comment #7 from Myk Taylor <myk002(a)yahoo.com> 2012-08-29 15:28:38 CDT --- Here's another example that results in a sharing violation: before this command executes, afile exists, somefile and outfile do not if not exist somefile copy /y afile somefile >>outfile Sharing violation. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #8 from Jason Edmeades <us(a)edmeades.me.uk> 2012-08-29 18:40:28 CDT --- Created attachment 41528 --> http://bugs.winehq.org/attachment.cgi?id=41528 Sample tests for some of the issues reported here Attached is a small test case that exercises some of the issues in here in a step by step progression. Expected results (on windows 7!) were: PASSED1 PASSED2 PASSED3 expected missing test 4 PASSED5 PASSED6 PASSED7 On wcmd (compiled/running on windows so dont trust these results completely): PASSED3 FAILED4 expected missing test 4 PASSED5 PASSED7 and a file leak on failed.txt I dont have Linux / much time either so cant convert this into the test suite, but I think it highlights the key issues here (I think one of the key problems is around passing the redirs through continually, rather than acting on them straight away and relying on the handles staying set). -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #9 from Jason Edmeades <us(a)edmeades.me.uk> 2013-06-11 16:39:43 CDT --- The discussions around sharing violations should be moved to bug 28037, which is specifically for those issues This bug was specifically around the way native echos <space>Redirects when redisplaying the command. Let's keep this bug to this purpose Now there is a question on whether its worth bothering to fix this - I seriously doubt any application will ever actually care that the output is missing a space except for the test runner, however it would be good to see if we can remove the kludge from the cmd runner. (The odd thing for me is I cannot actually see the hack in the test runner at first glance... needs more investigation!) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=21227 joaopa <jeremielapuree(a)yahoo.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree(a)yahoo.fr --- Comment #10 from joaopa <jeremielapuree(a)yahoo.fr> --- Does the bug still occur with current wine(4.0-rc1)? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #11 from Esme Povirk <madewokherd(a)gmail.com> --- Still present in Wine 6.0-rc5. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=21227 Neko-san <nekoNexus(a)protonmail.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nekoNexus(a)protonmail.ch -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=21227 lizhenbo <litimetal(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |litimetal(a)gmail.com --- Comment #12 from lizhenbo <litimetal(a)gmail.com> --- This is still an issue in wine 9.4, and hear is a simplified real world case - @if not defined _echo @echo off set _C=-c "import sys; sys.stdout.write(sys.executable)" (py -3 %_C% || py -2 %_C% || python3 %_C% || python2 %_C% || python %_C%) > pythonlocation.txt 2> NUL set _C= set /p PYTHON=pythonlocation.txt if NOT DEFINED PYTHON ( echo %__MsgPrefix%Error: Could not find a Python installation. exit /b 1 ) echo Success - -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=21227 Vijay Kamuju <infyquest(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest(a)gmail.com --- Comment #13 from Vijay Kamuju <infyquest(a)gmail.com> --- dir > blah > bad command always creates the empty file blah, but on windows it does not create it. Tested on wine 9.12 and windows 10 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 Eric Pouech <eric.pouech(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech(a)gmail.com --- Comment #14 from Eric Pouech <eric.pouech(a)gmail.com> --- (In reply to Vijay Kamuju from comment #13)
dir > blah > bad command always creates the empty file blah, but on windows it does not create it.
Tested on wine 9.12 and windows 10
retested on Wine 10.16, and only second redirected file is created -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #15 from Eric Pouech <eric.pouech(a)gmail.com> --- (In reply to Vijay Kamuju from comment #13)
dir > blah > bad command always creates the empty file blah, but on windows it does not create it.
Tested on wine 9.12 and windows 10
(In reply to lizhenbo from comment #12)
This is still an issue in wine 9.4, and hear is a simplified real world case
- @if not defined _echo @echo off set _C=-c "import sys; sys.stdout.write(sys.executable)" (py -3 %_C% || py -2 %_C% || python3 %_C% || python2 %_C% || python %_C%) > pythonlocation.txt 2> NUL set _C= set /p PYTHON=pythonlocation.txt if NOT DEFINED PYTHON ( echo %__MsgPrefix%Error: Could not find a Python installation. exit /b 1 ) echo Success -
not very clear to me how this relates to previous discussion (which were about extraneous white space on echoing commands) IMO, the script should be: set /p PYTHON=<pythonlocation.txt (mind the missing < after the =) but this fails on current Wine (10.16) unless written as set /p PYTHON=< pythonlocation.txt (mind the extra space after <) which looks like a lexer/parser issue; if all the assumptions just above are correct, please file a different bug -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=21227 --- Comment #16 from lizhenbo <litimetal(a)gmail.com> --- Hi Eric, Thank you for looking at it. It's likely that I didn't understand 21227 properly. Sorry for the confusion (In reply to Eric Pouech from comment #15)
(In reply to lizhenbo from comment #12)
This is still an issue in wine 9.4, and hear is a simplified real world case
not very clear to me how this relates to previous discussion (which were about extraneous white space on echoing commands)
-- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla