dired-hacks icon indicating copy to clipboard operation
dired-hacks copied to clipboard

[dired-collapse] Trouble with particular filename

Open amake opened this issue 7 years ago • 4 comments

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.

amake avatar Jul 20 '17 00:07 amake

Is the \015 part of the filename Icon or is Icon a directory with a file called \015? That backslash can be causing trouble.

Fuco1 avatar Jul 20 '17 09:07 Fuco1

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.

amake avatar Jul 20 '17 23:07 amake

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.

matthewbauer avatar Jul 26 '17 19:07 matthewbauer

Had this same problem. Switching to @matthewbauer 's fork for the time being.

jasonhemann avatar May 14 '22 15:05 jasonhemann