summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-01-03 00:35:57 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-01-03 00:38:44 +0100
commit045c0acc92a291d5bc785103e129516f99032f94 (patch)
tree61dab3864a58cc70e3eef510bea3b9b37b1088dc /lib
parent34e5cb5070a36f2462cf53b7c64c68931dd68d45 (diff)
downloadnextcloud-server-045c0acc92a291d5bc785103e129516f99032f94.tar.gz
nextcloud-server-045c0acc92a291d5bc785103e129516f99032f94.zip
workaround for 32-bit systems to handle filesizes bigger than 2GB
Diffstat (limited to 'lib')
-rw-r--r--lib/filestorage.php2
-rw-r--r--lib/filestorage/local.php19
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/filestorage.php b/lib/filestorage.php
index dd65f4421b7..2e03c4cb6da 100644
--- a/lib/filestorage.php
+++ b/lib/filestorage.php
@@ -21,7 +21,7 @@
*/
/**
- * Provde a common interface to all different storage options
+ * Provide a common interface to all different storage options
*/
abstract class OC_Filestorage{
abstract public function __construct($parameters);
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php
index 6fe45acf8c5..0bf6ad2d3d7 100644
--- a/lib/filestorage/local.php
+++ b/lib/filestorage/local.php
@@ -29,7 +29,24 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
return is_file($this->datadir.$path);
}
public function stat($path) {
- return stat($this->datadir.$path);
+ $fullPath = $this->datadir.$path;
+ $statResult = stat($fullPath);
+
+ // special case for 32-bit systems
+ if (PHP_INT_SIZE===4) {
+ if (!(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'))
+ $size = (float)exec('stat -c %s '. escapeshellarg ($fullPath));
+ else{
+ $fsobj = new COM("Scripting.FileSystemObject");
+ $f = $fsobj->GetFile($fullPath);
+ $size = $f->Size;
+ }
+
+ $statResult['size'] = $size;
+ $statResult[7] = $size;
+ }
+
+ return $statResult;
}
public function filetype($path) {
$filetype=filetype($this->datadir.$path);