Bug 15511 - embedded scanner fails on directory names ending in space
: embedded scanner fails on directory names ending in space
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.5.0
: PC Debian Linux
: P2 normal (vote)
: 7.6.0
Assigned To: Alan Young
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-20 13:40 UTC by snarlydwarf
Modified: 2011-01-21 07:47 UTC (History)
1 user (show)

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description snarlydwarf 2010-01-20 13:40:34 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.
Comment 1 Andy Grundman 2010-02-11 10:39:24 UTC
This was probably fixed by change 30136 to properly watch new directories.
Comment 2 snarlydwarf 2010-03-12 17:35:30 UTC
(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.)
Comment 3 Sébastien Phélep 2010-06-19 02:45:13 UTC
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...
Comment 4 Alan Young 2011-01-19 08:57:52 UTC
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.
Comment 5 SVN Bot 2011-01-21 07:47:59 UTC
 == 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.