Version: (using KDE 4.2.2)
Installed from: Debian testing/unstable Packages
Create a file called test"thing and try to open it in any KDE program, e.g. Kate, through the Open File dialog. The dialog will not recognise when you click on the "Okay" button. It'll just ignore you.
Create a file called test"thing"test and try similar. The dialog will recognise clicking the "Okay" button, but the program will attempt to open a file called thing, not test"thing"test.
Clearly the file dialog is attempting to interpret the quote marks rather than escape them (somehow). I realise there is a utility of this interpretation when selecting multiple files at once. However, as filenames with quote marks are perfectly valid (and not unheard of, I can imagine a file called A "Modest" Proposal.txt as an example), this situation needs to be resolved somehow. It's easy to create a file that apps will be unable to open, and it would not be obvious at all to the novice as to why.
I can confirm this happens, and it's similarly with the save dialog. Try to save a file called
and the file will be saves with the name xyz. Everything else is ignored.
I also confirm this with the save dialog, but when i create file from context menu in Dolphin, i choose Create New -> Text file... and when i type test"thing or test"thing"test.
About creating new file with one of those names up, i write on console:
and kate opens new file with name testthingtest.
(In reply to comment #2)
> About creating new file with one of those names up, i write on console:
> kate test"thing"test
> and kate opens new file with name testthingtest.
I'm almost certain that what is happening in that case is the bash interpreter (or your shell of choice) is stripping the quote characters in its normal way. This is expected. The command you should try is
This will cause the shell to take the argument in the single quotes literally, and pass test"thing"test to kate. When I run that command, kate makes a new file with those double quote marks, as expected. So, that particular behaviour is not related to this bug.
Confirmed with Kate on KDE 4.7.3, Kubuntu 11.10:
creating a file kate 'thing"test' opens a file with that name, but doesn't let me save it.
Creating a file with kate 'test"thing"test' opens a file with that name, but when I save it I end up with a file named thing.
This is still present in KDE SC 4.8.2. Some other funny things that can happen:
- There is a file 'a "b"'. You will not be able to open it at all.
- There is a file 'a "b"' and a folder 'b'. Clicking on the file opens the folder.
- There is a file '"'. Nothing happens when clicking on it.
- There is a file '"a" "b"' and two folders 'a' and 'b'. Clicking on the file causes an error message telling that you can not select more than one folder at once.
- Similar strange effects happen with a file named '~'. Actually, when opening such a file e. g. in Kate and then saving this with "Save As", the folder /home is opened.
No problems appear when opening a file from e. g. within Konqueror.
Line #1641 at kdelibs/kfile/kfilewidget.cpp contains the following statement:
// FIXME: current implementation drawback: a filename can't contain quotes
Unless that tokenize function is fixed, this issue will remain.
*** This bug has been marked as a duplicate of bug 185433 ***