[owncloud-devel] php 32 bit (arm) filemtime issue

Boris Ribalkin ribalkin at gmail.com
Fri Sep 11 21:08:11 GMT 2015


Alfred,

Looks like latest busybox has proper stat app:

http://www.busybox.net/downloads/BusyBox.html

*stat*

stat [OPTIONS] FILE...

Display file (default) or filesystem status

Options:

        -c fmt  Use the specified format
        -f      Display filesystem status
        -L      Dereference links
        -t      Display info in terse form



On Fri, Sep 11, 2015 at 2:54 PM, Boris Ribalkin <ribalkin at gmail.com> wrote:

> Sorry, I thought you also applied the fix from php website. If you did not
> and this is your original error message then probably you are facing a bit
> different issue because filemtime owncloud function right now does not use
> stat Linux app.
>
> But anyway your error tells that stat app you have does not support -c
> option. Try running 'stat --help' in your server shell.
> On Sep 11, 2015 13:58, "Alfred van Hoorn" <email at alfredvanhoorn.nl> wrote:
>
>> H Boris,
>>
>> I don't know what you mean by this. Please help.
>>
>> Alfred
>>
>> ------ Origineel bericht ------
>> Van: "Boris Ribalkin" <ribalkin at gmail.com>
>> Aan: "List for Developers of ownCloud" <devel at owncloud.org>
>> Verzonden: 11-9-2015 10:18:09
>> Onderwerp: Re: [owncloud-devel] php 32 bit (arm) filemtime issue
>>
>>
>> Alfred,
>>
>> Looks like you may try free bsd option (according to php website)
>>
>> On FreeBSD:
>> $mtime = exec ('stat -f %m '. escapeshellarg ($path));
>> On Sep 11, 2015 07:42, "Alfred van Hoorn" <email at alfredvanhoorn.nl>
>> wrote:
>>
>>> Hi,
>>>
>>> I am also facing an issue with file:scan. While running that command I
>>> am receiving many, many, many times the next message:
>>>
>>>          stat: invalid option -- 'c'
>>>          BusyBox v1.16.1 (2015-06-29 18:12:44 CST) multi-call binary.
>>>
>>>          Usage: stat [OPTIONS] FILE...
>>>
>>>          Display file (default) or filesystem status
>>>
>>>          Options:
>>>                  -f      Display filesystem status
>>>                  -L      Follow links
>>>                  -t      Display info in terse form
>>>
>>> I am running OwnCloud on a Synology Diskstation. Synology implemented
>>> the Busybox shell on their Diskstations.
>>>
>>> Cheers,
>>> Alfred van Hoorn
>>>
>>>
>>> Op 10 sep. 2015 om 23:07 heeft Boris Ribalkin <ribalkin at gmail.com> het
>>> volgende geschreven:
>>>
>>> Hi All,
>>>
>>> I am facing an issue with running file:scan on arm:
>>>
>>> filemtime(): stat failed
>>>
>>> Looks like the reason is filemtime [1] is not working for files over 2G
>>> on 32 bit php [2]
>>>
>>> Fixing function according to php website comment solved the problem:
>>>   exec ('stat -c %Y '. escapeshellarg ($this->getSourcePath($path)));
>>>
>>> I am sure that worked fine in past with older owncloud/php versions on
>>> the same hardware.
>>>
>>> Is there something I am missing or this never worked on php (32bit) /
>>> arm?
>>> Or is it possible to have some if, like:
>>>
>>> if (PHP_INT_SIZE === 4)
>>>    return exec ('stat -c %Y '. escapeshellarg
>>> ($this->getSourcePath($path)));
>>> else
>>>    return filemtime($this->getSourcePath($path));
>>>
>>>
>>> I cannot upgrade php to 64 bit on arm board as there there is no such
>>> thing yet as arm64 or at least not popular enough on single board computers
>>> yet.
>>>
>>> [1] http://php.net/manual/en/function.filemtime.php#68814
>>> [2]
>>> https://github.com/owncloud/core/blob/master/lib/private/files/storage/local.php#L159
>>>
>>> My system:
>>> ownCloud version 8.0.4
>>> PHP Version => 5.6.9
>>> System => Linux cubietruck 3.4.79-sun7i #13 SMP PREEMPT Thu Jul 3
>>> 06:34:55 CST 2014 armv7l
>>> Configure Command =>  './configure'  '--enable-fpm' '--with-pgsql'
>>> '--with-pdo-pgsql' '--enable-opcache' '--prefix'
>>> '--with-config-file-path=/root/build/install/config' '--with-gd'
>>> '--enable-zip' '--with-zlib' '--with-curl' '--with-readline' '--with-ldap'
>>> '--with-ldap-sasl' '--with-libdir=lib/arm-linux-gnueabihf'
>>> '--enable-mbstring'
>>>
>>> Thank you
>>>
>>> --
>>> Boris Rybalkin
>>> ribalkin at gmail.com
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at owncloud.org
>>> http://mailman.owncloud.org/mailman/listinfo/devel
>>>
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at owncloud.org
>>> http://mailman.owncloud.org/mailman/listinfo/devel
>>>
>>>
>> _______________________________________________
>> Devel mailing list
>> Devel at owncloud.org
>> http://mailman.owncloud.org/mailman/listinfo/devel
>>
>>


-- 
Boris Rybalkin
ribalkin at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150911/06d38644/attachment-0001.html>


More information about the Devel mailing list