Bug 296825 - Saving filename with slashes unexpectedly creates a directory tree
Summary: Saving filename with slashes unexpectedly creates a directory tree
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-26 17:02 UTC by tjbp
Modified: 2021-07-21 20:17 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tjbp 2012-03-26 17:02:02 UTC
When saving a document with forward slashes in the filename, a directory structure is created instead of returning an error. For example, saving a document from LibreOffice with the filename '2012/03/26' will result in a dir named 2012, a dir within that named 03, and a file within that named 26.

I appreciate that this is a feature for a more knowledgeable *nix user, but in the UK dates are frequently written with forward slashes instead of hyphens or full-stops. A friend of mine is a journalist and recently switched to a distro featuring KDE - he wishes to save documents with dates in the filename in this format. Recursively generating a directory structure can be hugely perplexing for a user that isn't aware of the special function of a forward slash.

Additionally Dolphin behaves completely differently and converts a slash in the filename of a new directory into a different character altogether. Perhaps we could conclude on a consistent approach for this in KDE? I propose a global setting to choose whether slashes are respected as directory operators (advanced), or disallowed from filenames as invalid chars.
Comment 1 Aaron Peterson 2012-04-30 08:06:10 UTC
actually, the lastest dolphin "creates" a filename  your/file/name

and hangs...

I agree that some sort of ?are you sure?  would be best here.

If kfile can handel non-modal dialogs that would be the best.

Or, if it creates the directories as one step, and then has you hit save again... 


Or, another option is to use a non-modal dialog with a timer.

About to to create the folders  foo/bar/qux/baz/  reconsider? 3... 2... 1... 

Or, I think this is best:
non-modal-dialogbox:
 Click ok again to create folders and save file.
Comment 2 Ahmad Samir 2021-07-21 20:17:48 UTC
/ can't be used as part of a file/dir name in Linux, because / is the path separator, there is no way around that.

For some time now, if you try to create a file/folder with '/', the dialog will show a message telling you it's going to create a dir tree.

The alternative character is a unicode character that looks like / but isn't the same character.

I agree, acting differently when creating a file vs a dir is a bit confusing.

Anyway, this report is about creating a dir tree when creating a new folder a/b/c, this particular issue is mitigated by the message displayed by the create new dialog. Closing this report, feel free to open separate reports for the other issues.