summaryrefslogtreecommitdiffstats
path: root/lib/files/cache/scanner.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-02-10 14:16:45 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-02-10 14:16:45 +0100
commit1263511a179fb1508f41207d61d76739e087b239 (patch)
treec8d848e174f6ff0f14971ae81f95663aa17e8af7 /lib/files/cache/scanner.php
parent1c56539c01c162676a05d90e3598b7d68394ac73 (diff)
downloadnextcloud-server-1263511a179fb1508f41207d61d76739e087b239.tar.gz
nextcloud-server-1263511a179fb1508f41207d61d76739e087b239.zip
append .part to put files
Diffstat (limited to 'lib/files/cache/scanner.php')
-rw-r--r--lib/files/cache/scanner.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index 9a5546dce3f..5a9a119458e 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -97,7 +97,7 @@ class Scanner {
if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) {
\OC_DB::beginTransaction();
while ($file = readdir($dh)) {
- if ($file !== '.' and $file !== '..') {
+ if (!$this->isIgnoredFile($file)) {
$child = ($path) ? $path . '/' . $file : $file;
$data = $this->scanFile($child);
if ($data) {
@@ -133,6 +133,22 @@ class Scanner {
}
return $size;
}
+
+ /**
+ * @brief check if the file should be ignored when scanning
+ * NOTE: files with a '.part' extension are ignored as well!
+ * prevents unfinished put requests to be scanned
+ * @param String $file
+ * @return boolean
+ */
+ private function isIgnoredFile($file) {
+ if ($file === '.' || $file === '..'
+ || pathinfo($file,PATHINFO_EXTENSION) === 'part')
+ {
+ return true;
+ }
+ return false;
+ }
/**
* walk over any folders that are not fully scanned yet and scan them