dired-hacks
dired-hacks copied to clipboard
[dired-collapse] Trouble with particular filename
First, thanks for the great mode.
I'm using dired-collapse on macOS, and I find that a particular file causes dired-collapse-mode to fail to activate: ~/Applications (Parallels)/Icon\015
I have dired-collapse-mode added to dired-mode-hook, and when I try to open ~ in a buffer I get the following message and the buffer fails to open:
insert-directory: Reading directory: No such file or directory, Applications (Parallels)/Icon
The file in question is automatically created by Parallels, so I imagine others might have similar problems.
Is the \015 part of the filename Icon or is Icon a directory with a file called \015? That backslash can be causing trouble.
Sorry I wasn't clear. It's a file named Icon\r (with a literal carriage return on the end); this is expressed in a dired buffer as Icon\015.
I've got the same problem.
I've got a fix here: https://github.com/matthewbauer/dired-hacks/commit/915831088188ae32a07d3b75b173df4cd5c21a2c
It just filters out \r and \n without addressing the root problem. It seems like the root problem has to do with `insert-directory' not liking unescaped returns in filenames. Probably some sort of cleanup is necessary to get it to work correctly.
Had this same problem. Switching to @matthewbauer 's fork for the time being.