http://bugs.winehq.org/show_bug.cgi?id=14901
Summary: MoveFile fails when used to recase some letters of the filename Product: Wine Version: 1.1.2 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: redneb@mailinator.com
When my program executes the MoveFile windows API function having as arguments two strings that are equal (in a case insensitive way) then MoveFile fails and GetLastError returns 183 (i.e. "File already exists"). For example, assume that the current directory contains a file "foobar". If you run MoveFile("foobar","Foobar") you will get the above error. On the contrary this works fine under windows. Even MoveFile("foobar","foobar") works under windows. I have tested that with 0.9.61/1.1.0/1.1.2 (under Gentoo) and 1.0.0 (under Ubuntu).
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #1 from James Hawkins truiken@gmail.com 2008-08-18 01:16:11 --- Please add a test to the Wine test suite to prove this behavior. See wine/dlls/kernel32/tests/file.c
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #2 from redneb@mailinator.com 2008-08-19 02:15:39 --- Created an attachment (id=15481) --> (http://bugs.winehq.org/attachment.cgi?id=15481) adds an extra test for MoveFileA
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #3 from redneb@mailinator.com 2008-08-19 02:16:19 --- I added a function called test_2_MoveFileA in wine/dlls/kernel32/tests/file.c that should exemplify the problem. I was not able to verify this becauce "make test" fails in other tests earlier. Also this function doesn't test MoveFileW which also has the bug.
http://bugs.winehq.org/show_bug.cgi?id=14901
James Hawkins truiken@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
--- Comment #4 from James Hawkins truiken@gmail.com 2008-08-19 02:18:29 --- Please add those tests to the existing test_MoveFileA tests then submit the patch to wine-patches. bugzilla is not scanned for patches.
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #5 from James Hawkins truiken@gmail.com 2008-08-19 02:19:13 --- Also note: * no c++ comments * failing tests have to be wrapped in todo_wine, see the rest of the file for examples
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #6 from redneb@mailinator.com 2008-08-19 04:23:03 --- In order to write a proper test it would help if I could run "make test" successfully (when my patch is not applied) so that I can check whether my patch does what it is supposed to. Isn't "make test" supposed to succeed?
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #7 from James Hawkins truiken@gmail.com 2008-08-19 04:36:03 --- Where are you running make test from?
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #8 from redneb@mailinator.com 2008-08-19 05:10:19 ---
From the top directory
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #9 from Austin English austinenglish@gmail.com 2008-08-19 09:54:07 --- (In reply to comment #6)
In order to write a proper test it would help if I could run "make test" successfully (when my patch is not applied) so that I can check whether my patch does what it is supposed to. Isn't "make test" supposed to succeed?
It fails on older window managers/quite a few video cards. Use:
$ make -k test
to ignore failures. Ignore anything in user32/d3d* (unless you changed something there).
http://bugs.winehq.org/show_bug.cgi?id=14901
redneb@mailinator.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #15481|0 |1 is obsolete| |
--- Comment #10 from redneb@mailinator.com 2008-08-20 03:58:50 --- Created an attachment (id=15498) --> (http://bugs.winehq.org/attachment.cgi?id=15498) adds an extra test case for MoveFileA
I merged the two functions. In order to check it I used the following command:
../../../tools/runtest -q -P wine -M kernel32.dll -T ../../.. -p kernel32_test.exe.so file.c
from the wine/dlls/kernel32/tests directory
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #11 from Austin English austinenglish@gmail.com 2009-02-20 13:34:46 --- I sent a modified testcase that was committed today: http://source.winehq.org/git/wine.git/?a=commitdiff;h=68cc3ff120756977c08033...
I'd suggest closing this bug as abandoned/invalid...we've got a testcase for it, so we'll know when the bug is fixed (when the todo_wine is removed). No need to keep a bugzilla bug open for it.
http://bugs.winehq.org/show_bug.cgi?id=14901
redneb@gmx.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |redneb@gmx.com
--- Comment #12 from redneb@gmx.com 2009-03-09 13:34:26 --- (In reply to comment #11)
I sent a modified testcase that was committed today: http://source.winehq.org/git/wine.git/?a=commitdiff;h=68cc3ff120756977c08033...
Your testcase doesn't test the case when letter recasing occurs such as MoveFile("foobar","Foobar")
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #13 from Austin English austinenglish@gmail.com 2009-03-09 22:45:50 --- (In reply to comment #12)
(In reply to comment #11)
I sent a modified testcase that was committed today: http://source.winehq.org/git/wine.git/?a=commitdiff;h=68cc3ff120756977c08033...
Your testcase doesn't test the case when letter recasing occurs such as MoveFile("foobar","Foobar")
http://www.winehq.org/pipermail/wine-devel/2009-February/073307.html
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #14 from redneb@gmx.com 2009-03-10 00:21:59 --- (In reply to comment #13)
(In reply to comment #12)
(In reply to comment #11)
I sent a modified testcase that was committed today: http://source.winehq.org/git/wine.git/?a=commitdiff;h=68cc3ff120756977c08033...
Your testcase doesn't test the case when letter recasing occurs such as MoveFile("foobar","Foobar")
http://www.winehq.org/pipermail/wine-devel/2009-February/073307.html
That's not correct. MoveFile("foobar","Foobar") works just fine under windows (i.e. it's not a noop, it *does* recase the filename). The test should test that case as well.
http://bugs.winehq.org/show_bug.cgi?id=14901
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
--- Comment #15 from Austin English austinenglish@gmail.com 2009-03-10 03:12:21 --- I'll take a look.
http://bugs.winehq.org/show_bug.cgi?id=14901
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #15498|0 |1 is obsolete| |
--- Comment #16 from Austin English austinenglish@gmail.com 2009-03-10 14:29:26 --- Created an attachment (id=19866) --> (http://bugs.winehq.org/attachment.cgi?id=19866) testcase
Passes on Wine/2K/XP. Does that test what you want?
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #17 from redneb@gmx.com 2009-03-11 00:22:32 --- (In reply to comment #16)
Created an attachment (id=19866)
--> (http://bugs.winehq.org/attachment.cgi?id=19866) [details]
testcase
Passes on Wine/2K/XP. Does that test what you want?
Yes
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #18 from Austin English austinenglish@gmail.com 2009-03-12 12:30:18 --- (In reply to comment #17)
(In reply to comment #16)
Created an attachment (id=19866)
--> (http://bugs.winehq.org/attachment.cgi?id=19866) [details] [details]
testcase
Passes on Wine/2K/XP. Does that test what you want?
Yes
There's not really a need to test that...wine already deals with files in a case insensitive way. When the testcase I already submitted is fixed, your case will be as well.
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #19 from redneb@gmx.com 2009-03-14 15:16:41 --- (In reply to comment #18)
(...) wine already deals with files in a case insensitive way (...)
That's where the problem is. Windows has case insensitive filename semantics but MoveFile is case sensitive in some ways. So I wouldn't be surprised if someone fixes your test case but the problem is still there. On the other hand, I don't really know much about the internals of wine so I might be mistaken.
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #20 from Dmitry Timoshkov dmitry@codeweavers.com 2009-03-16 00:24:14 --- (In reply to comment #16)
Created an attachment (id=19866)
--> (http://bugs.winehq.org/attachment.cgi?id=19866) [details]
testcase Passes on Wine/2K/XP. Does that test what you want?
There is no need for such a complicated test, to create an uppercased version of source it's enough to do LCMapString(LCMAP_UPPERCASE, source, dest); and call MoveFile() once again. But you still don't test the result of the the MoveFile() call, that's not just a return value, that's also a file name of the target. That could be accomplished by calling FindFirstFile(source) and comparing the returned buffer with dest (in a case insensitive way).
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #21 from Dmitry Timoshkov dmitry@codeweavers.com 2009-03-16 00:26:56 --- (In reply to comment #20)
(in a case insensitive way).
s/insensitive/sensitive/
i.e. as simple lstrcmp() does.
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #22 from Austin English austinenglish@gmail.com 2009-09-15 15:34:40 --- Is this still an issue in current (1.1.29 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #23 from redneb@gmx.com 2009-09-15 16:47:16 --- (In reply to comment #22)
Is this still an issue in current (1.1.29 or newer) wine?
Yes, the bug is still there in commit 4e6db1e18637106aef1f736dad6e9fcd6ff6dc3e.
http://bugs.winehq.org/show_bug.cgi?id=14901
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|austinenglish@gmail.com |
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #24 from Austin English austinenglish@gmail.com 2012-03-19 14:52:27 CDT --- This is your friendly reminder that there has been no bug activity for 650 days. Is this still an issue in current (1.4 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=14901
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #25 from Bruno Jesus 00cpxxx@gmail.com 2012-03-19 18:55:05 CDT --- Still present as seen in the dupe bug 27084.
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #26 from redneb@gmx.com 2012-03-19 19:33:54 CDT --- Yup, it's still present.
http://bugs.winehq.org/show_bug.cgi?id=14901
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tastky@gmail.com
--- Comment #27 from Bruno Jesus 00cpxxx@gmail.com 2012-04-25 22:50:03 CDT --- *** Bug 27084 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=14901
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|UNCONFIRMED |NEW URL| |http://www.mp3tag.de/en/dow | |nload.html Ever Confirmed|0 |1
--- Comment #28 from Bruno Jesus 00cpxxx@gmail.com 2012-04-25 23:02:30 CDT --- Confirming and adding a real application: mp3tag
My original rejected patch to fix this is in http://bugs.winehq.org/attachment.cgi?id=39257
http://bugs.winehq.org/show_bug.cgi?id=14901
tristan hontoir@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hontoir@gmail.com
--- Comment #29 from tristan hontoir@gmail.com 2012-11-12 05:06:35 CST --- Same problem in foobar2000 v1.1.16 when using "File Operations" > "Move To..."
http://bugs.winehq.org/show_bug.cgi?id=14901
Mark K markk@clara.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |markk@clara.co.uk
--- Comment #30 from Mark K markk@clara.co.uk --- WinUAE is another program affected by this bug; see bug 35772.
http://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #31 from Mark K markk@clara.co.uk --- *** Bug 35772 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=14901
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #32 from super_man@post.com --- patching file dlls/kernel32/path.c Hunk #1 succeeded at 1251 (offset 182 lines). Hunk #2 succeeded at 1272 (offset 182 lines). Hunk #3 succeeded at 1311 (offset 182 lines). Hunk #4 succeeded at 1330 (offset 182 lines).
Bruno's patch still applies 1.7.51
https://bugs.winehq.org/show_bug.cgi?id=14901
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #33 from winetest@luukku.com ---
Bruno's patch still applies 1.7.51
patching file dlls/kernel32/path.c Hunk #1 succeeded at 1237 (offset 168 lines). Hunk #2 succeeded at 1258 (offset 168 lines). Hunk #3 succeeded at 1297 (offset 168 lines). Hunk #4 succeeded at 1316 (offset 168 lines).
Against 1.9.22-git.
https://bugs.winehq.org/show_bug.cgi?id=14901
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/kernel32-MoveF | |ile CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, michael@fds-team.de, | |sebastian@fds-team.de Status|NEW |STAGED
https://bugs.winehq.org/show_bug.cgi?id=14901
Omega Software development@winomega.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |development@winomega.com
--- Comment #34 from Omega Software development@winomega.com --- Created attachment 60965 --> https://bugs.winehq.org/attachment.cgi?id=60965 Bruno's patch from bug 27084 + remove todo_wine
Bruno's patch still works with current Wine. It was missing the removal of todo_wine for MoveFileA test, so adding it here.
Bruno said in bug 27084 that his patch was rejected, but I can't find this in wine-devel archives.
Does anyone know the reason it was rejected?
https://bugs.winehq.org/show_bug.cgi?id=14901
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset|https://github.com/wine-com |https://github.com/wine-sta |pholio/wine-staging/tree/ma |ging/wine-staging/tree/mast |ster/patches/kernel32-MoveF |er/patches/kernel32-MoveFil |ile |e CC| |nerv@dawncrow.de
https://bugs.winehq.org/show_bug.cgi?id=14901
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexhenrie24@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #35 from Mathew Hodson mathew.hodson@gmail.com --- https://source.winehq.org/git/wine.git/commitdiff/7edfcd63ada3206b62f4fcee7b...
Is this fixed after this commit?
https://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #36 from redneb@gmx.com --- I wouldn't say it is. While the behavior has now improved, as it does not return an error anymore, you still cannot change the case of the letters of a filename, i.e. you cannot rename "test.txt" to "TEST.TXT". If you try to do that, no error will be reported, but the filename will remain "test.txt".
https://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #37 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to redneb from comment #36)
I wouldn't say it is. While the behavior has now improved, as it does not return an error anymore, you still cannot change the case of the letters of a filename, i.e. you cannot rename "test.txt" to "TEST.TXT". If you try to do that, no error will be reported, but the filename will remain "test.txt".
I'd suggest to create a separate bug report for file name recasing, since MoveFile() no longer fails this bug could be maked as resolved.
https://bugs.winehq.org/show_bug.cgi?id=14901
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathanbelsewir@yahoo.de
--- Comment #38 from Dmitry Timoshkov dmitry@baikal.ru --- *** Bug 46505 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #39 from Dmitry Timoshkov dmitry@baikal.ru --- *** Bug 46505 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=14901
--- Comment #40 from Gijs Vermeulen gijsvrm@gmail.com --- (In reply to Dmitry Timoshkov from comment #37)
I'd suggest to create a separate bug report for file name recasing, since MoveFile() no longer fails this bug could be maked as resolved.
I think bug 46203 would be a good candidate, if I'm not mistaken.
https://bugs.winehq.org/show_bug.cgi?id=14901
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |7edfcd63ada3206b62f4fcee7b6 | |5d7a165a0cd9b Resolution|--- |FIXED Status|STAGED |RESOLVED
--- Comment #41 from Gijs Vermeulen gijsvrm@gmail.com --- (In reply to Gijs Vermeulen from comment #40)
(In reply to Dmitry Timoshkov from comment #37)
I'd suggest to create a separate bug report for file name recasing, since MoveFile() no longer fails this bug could be maked as resolved.
I think bug 46203 would be a good candidate, if I'm not mistaken.
I'll go ahead and mark this FIXED, the recasing issue is tracked in the bug mentioned above.
https://bugs.winehq.org/show_bug.cgi?id=14901
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #42 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.0-rc3.