{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/19711","labels_url":"https://api.github.com/repos/owncloud/core/issues/19711/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/19711/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/19711/events","html_url":"https://github.com/owncloud/core/issues/19711","id":110974934,"number":19711,"title":"scanFile event gets triggered on directories","user":{"login":"mmattel","id":3321281,"avatar_url":"https://avatars.githubusercontent.com/u/3321281?v=3","gravatar_id":"","url":"https://api.github.com/users/mmattel","html_url":"https://github.com/mmattel","followers_url":"https://api.github.com/users/mmattel/followers","following_url":"https://api.github.com/users/mmattel/following{/other_user}","gists_url":"https://api.github.com/users/mmattel/gists{/gist_id}","starred_url":"https://api.github.com/users/mmattel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmattel/subscriptions","organizations_url":"https://api.github.com/users/mmattel/orgs","repos_url":"https://api.github.com/users/mmattel/repos","events_url":"https://api.github.com/users/mmattel/events{/privacy}","received_events_url":"https://api.github.com/users/mmattel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-12T13:27:05Z","updated_at":"2015-10-12T14:25:13Z","closed_at":"2015-10-12T14:25:13Z","body":"I am currently working on a PR on core/apps/files/command/scan.php\r\nWhen testing the original code, I have seen an interesting output which was wondering me.\r\n\r\nWhy do we get, when using ``$scanner->listen('\\OC\\Files\\Utils\\Scanner', 'scanFile'``, an event triggered for a directory? IMHO this should not be the case, or do I have missed something...\r\n(Ubuntu, clone from master, no external mounts, no encryption)\r\n\r\nsudo -u www-data ./occ files:scan --all\r\n\r\n````\r\nScanning file   /user_name/\t\t\t\t\t\t\t<-- ?\r\nScanning folder /user_name/\r\nScanning file   /user_name/files\t\t\t\t\t<-- ?\r\nScanning file   /user_name/thumbnails\t\t\t\t<-- ?\r\nScanning file   /user_name/cache\t\t\t\t\t<-- ?\r\nScanning file   /user_name/files_trashbin\t\t\t<-- ?\r\nScanning folder /user_name/files\r\nScanning file   /user_name/files/welcome.txt\r\nScanning file   /user_name/files/New text file.txt\r\nScanning file   /user_name/files/New text file1.txt\r\nScanning file   /user_name/files/New text file2.txt\r\nScanning file   /user_name/files/New folder\t\t\t<-- ?\r\nScanning file   /user_name/files/New folder1\t\t<-- ?\r\nScanning folder /user_name/files/New folder\t\r\nScanning folder /user_name/files/New folder1\r\nScanning folder /user_name/thumbnails\r\nScanning folder /user_name/cache\r\nScanning folder /user_name/files_trashbin\r\nScanning file   /user_name/files_trashbin/files\t\t<-- ?\r\nScanning folder /user_name/files_trashbin/files\r\n````\r\n\r\ncore/apps/files/command/scan.php\r\n\r\n````\r\n$scanner->listen('\\OC\\Files\\Utils\\Scanner', 'scanFile', \r\n\tfunction ($path) use ($output) {$output->writeln(\"Scanning file   <info>$path</info>\");\t});\r\n$scanner->listen('\\OC\\Files\\Utils\\Scanner', 'scanFolder', \r\n\tfunction ($path) use ($output) {$output->writeln(\"Scanning folder <info>$path</info>\"); });\r\n````"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/147412620","html_url":"https://github.com/owncloud/core/issues/19711#issuecomment-147412620","issue_url":"https://api.github.com/repos/owncloud/core/issues/19711","id":147412620,"user":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T14:25:13Z","updated_at":"2015-10-12T14:25:13Z","body":"Duplicate of #19458"}}