Bugzilla – Bug 15511
embedded scanner fails on directory names ending in space
Last modified: 2011-01-21 07:47:59 UTC
the following commands don't get picked up: mkdir Test cd Test mkdir 'Foo ' cd 'Foo ' cp ~/somefile.mp3 . The scanner will not notice 'Foo /somefile.mp3' Repeating the sequence without the space at the end of Foo works. Looks like something is trimming whitespace from the path. (Annoyingly, I have a few directories with such whitespace and I see: [10-01-20 13:19:44.7722] Slim::Utils::AutoRescan::Linux::__ANON__ (167) Warning: Inotify watch creation failed for /home/mp3/mserv/mp3/John Zorn/Masada/Masada Book Two/Orobas - Book Of Angels Vol. 4: No such file or directory There is for no good reason, a space at the end of that path, which has vanished in the error message, hence my trying to break things with a space.
This was probably fixed by change 30136 to properly watch new directories.
(In reply to comment #1) > This was probably fixed by change 30136 to properly watch new directories. Hrm. it doesn't seem to work right for me. On startup, I see: [10-03-12 17:29:12.0768] Slim::Utils::AutoRescan::Linux::__ANON__ (233) Warning: Inotify watch creation failed for /home/mp3/mserv/mp3/Test/Directory With A Space At The End: No such file or directory [10-03-12 17:29:12.0782] Slim::Utils::AutoRescan::Linux::__ANON__ (233) Warning: Inotify watch creation failed for /home/mp3/mserv/mp3/Test/Another Space at the End: No such file or directory This is with r30366 (The above directory names, as their name imply, have a space at the end. The log message does not display the space, which explains why the no-file-or-dir error, since the space is being removed somewhere.)
I could see the same behaviour on my NV+ with 7.6.0-r30918: [10-06-19 11:23:45.0639] Slim::Utils::AutoRescan::Linux::__ANON__ (233) Warning: Inotify watch creation failed for /c/media/Music/flac/Tom Kerstens and G Plus: No such file or directory [10-06-19 11:26:54.4840] Slim::Utils::AutoRescan::Linux::__ANON__ (233) Warning: Inotify watch creation failed for /c/media/Music/flac/Belmondo & Milton Nascimento/Milton Nascimento & Belmondo: No such file or directory [10-06-19 11:27:06.5572] Slim::Utils::AutoRescan::Linux::__ANON__ (233) Warning: Inotify watch creation failed for /c/media/Music/flac/General Elektriks/Good City For Dreamers: No such file or directory [10-06-19 11:27:06.8168] Slim::Utils::AutoRescan::Linux::__ANON__ (233) Warning: Inotify watch creation failed for /c/media/Music/flac/Cliff Martinez/Solaris: No such file or directory No reason those folders would have a trailing space in their names, but...
The problem is that URI::file->new() uses URI::new(), which does the following: $uri =~ s/^"(.*)"$/$1/; $uri =~ s/^\s+//; $uri =~ s/\s+$//; thus removing leading and trailing spaces. I'm not sure how to proceed with this. It seems to me that URI is broken but I'm sure that 'fixing' it to leave leading and trailing spaces alone would cause other problems.
== Auto-comment from SVN commit #31796 to the slim repo by ayoung == == http://svn.slimdevices.com/slim?view=revision&revision=31796 == Fixed bug 15511: embedded scanner fails on directory names ending in space Temporarily add '/' to paths where it will defeat URI::new()'s trailing-space stripping behaviour.