#49466 [NEW]: Gtk::timeout_add updates "date" function but not "filesize"

View: New views
4 Messages — Rating Filter:   Alert me  

#49466 [NEW]: Gtk::timeout_add updates "date" function but not "filesize"

by Php - GTK - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From:             willgriffiths1 at yahoo dot co dot uk
Operating system: Windows Vista
PHP version:      5.3.0
PHP Bug Type:     PHP-GTK related
Bug description:  Gtk::timeout_add updates "date" function but not "filesize"

Description:
------------
I put PHP 5.3 because it made me pick a version. I'm actually using
PHP-GTK2.

The function in the example given echos the 'date' and the 'filesize'
every 3 seconds.

However, while the date updates correctly (+3 seconds each time), the
filesize stays the same even if you increase the size of the file.

Is this expected behaviour?

Reproduce code:
---------------
Gtk::timeout_add(3000, 'update', $store);

function update($store) {

$offset = filesize('file.txt') - 100;
echo $offset." ".date('H:i:s')."\r\n";

}

Expected result:
----------------
195382 11:18:06
195387 11:18:09
195399 11:18:12
...

Actual result:
--------------
195380 11:18:06
195380 11:18:09
195380 11:18:12
...


--
Edit bug report at http://bugs.php.net/?id=49466&edit=1
--
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=49466&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=49466&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=49466&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=49466&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49466&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=49466&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=49466&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=49466&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=49466&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=49466&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=49466&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=49466&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=49466&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=49466&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49466&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49466&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=49466&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=49466&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=49466&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=49466&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=49466&r=mysqlcfg


--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


#49466 [Com]: Gtk::timeout_add updates "date" function but not "filesize"

by Php - GTK - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 ID:               49466
 Comment by:       Keisial at gmail dot com
 Reported By:      willgriffiths1 at yahoo dot co dot uk
 Status:           Open
 Bug Type:         PHP-GTK related
 Operating System: Windows Vista
 PHP Version:      5.3.0
 New Comment:

That's not a problem with PHP-GTK, but with filesize() function of PHP.
And yes, this is intentional. You need to call clearstatcache() between
filesize()s to see the changes.

http://php.net/filesize
"Note: The results of this function are cached. See clearstatcache()
for more details."

http://php.net/manual/en/function.clearstatcache.php
"When you use stat(), lstat(), or any of the other functions listed in
the affected functions list (below), PHP caches the information those
functions return in order to provide faster performance. However, in
certain cases, you may want to clear the cached information. For
instance, if the same file is being checked multiple times within a
single script, and that file is in danger of being removed or changed
during that script's operation, you may elect to clear the status
cache."


Previous Comments:
------------------------------------------------------------------------

[2009-09-04 10:36:48] willgriffiths1 at yahoo dot co dot uk

Description:
------------
I put PHP 5.3 because it made me pick a version. I'm actually using
PHP-GTK2.

The function in the example given echos the 'date' and the 'filesize'
every 3 seconds.

However, while the date updates correctly (+3 seconds each time), the
filesize stays the same even if you increase the size of the file.

Is this expected behaviour?

Reproduce code:
---------------
Gtk::timeout_add(3000, 'update', $store);

function update($store) {

$offset = filesize('file.txt') - 100;
echo $offset." ".date('H:i:s')."\r\n";

}

Expected result:
----------------
195382 11:18:06
195387 11:18:09
195399 11:18:12
...

Actual result:
--------------
195380 11:18:06
195380 11:18:09
195380 11:18:12
...



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=49466&edit=1


--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


#49466 [Opn]: Gtk::timeout_add updates "date" function but not "filesize"

by Php - GTK - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 ID:               49466
 User updated by:  willgriffiths1 at yahoo dot co dot uk
 Reported By:      willgriffiths1 at yahoo dot co dot uk
 Status:           Open
 Bug Type:         PHP-GTK related
 Operating System: Windows Vista
 PHP Version:      5.3.0
 New Comment:

Thank you for the quick response and clear explanation.


Previous Comments:
------------------------------------------------------------------------

[2009-09-05 12:08:53] Keisial at gmail dot com

That's not a problem with PHP-GTK, but with filesize() function of PHP.
And yes, this is intentional. You need to call clearstatcache() between
filesize()s to see the changes.

http://php.net/filesize
"Note: The results of this function are cached. See clearstatcache()
for more details."

http://php.net/manual/en/function.clearstatcache.php
"When you use stat(), lstat(), or any of the other functions listed in
the affected functions list (below), PHP caches the information those
functions return in order to provide faster performance. However, in
certain cases, you may want to clear the cached information. For
instance, if the same file is being checked multiple times within a
single script, and that file is in danger of being removed or changed
during that script's operation, you may elect to clear the status
cache."

------------------------------------------------------------------------

[2009-09-04 10:36:48] willgriffiths1 at yahoo dot co dot uk

Description:
------------
I put PHP 5.3 because it made me pick a version. I'm actually using
PHP-GTK2.

The function in the example given echos the 'date' and the 'filesize'
every 3 seconds.

However, while the date updates correctly (+3 seconds each time), the
filesize stays the same even if you increase the size of the file.

Is this expected behaviour?

Reproduce code:
---------------
Gtk::timeout_add(3000, 'update', $store);

function update($store) {

$offset = filesize('file.txt') - 100;
echo $offset." ".date('H:i:s')."\r\n";

}

Expected result:
----------------
195382 11:18:06
195387 11:18:09
195399 11:18:12
...

Actual result:
--------------
195380 11:18:06
195380 11:18:09
195380 11:18:12
...



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=49466&edit=1


--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


#49466 [Opn->Bgs]: Gtk::timeout_add updates "date" function but not "filesize"

by auroraeosrose :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 ID:               49466
 Updated by:       auroraeosrose@...
 Reported By:      willgriffiths1 at yahoo dot co dot uk
-Status:           Open
+Status:           Bogus
 Bug Type:         PHP-GTK related
 Operating System: Windows Vista
 PHP Version:      5.3.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2009-09-05 16:19:58] willgriffiths1 at yahoo dot co dot uk

Thank you for the quick response and clear explanation.

------------------------------------------------------------------------

[2009-09-05 12:08:53] Keisial at gmail dot com

That's not a problem with PHP-GTK, but with filesize() function of PHP.
And yes, this is intentional. You need to call clearstatcache() between
filesize()s to see the changes.

http://php.net/filesize
"Note: The results of this function are cached. See clearstatcache()
for more details."

http://php.net/manual/en/function.clearstatcache.php
"When you use stat(), lstat(), or any of the other functions listed in
the affected functions list (below), PHP caches the information those
functions return in order to provide faster performance. However, in
certain cases, you may want to clear the cached information. For
instance, if the same file is being checked multiple times within a
single script, and that file is in danger of being removed or changed
during that script's operation, you may elect to clear the status
cache."

------------------------------------------------------------------------

[2009-09-04 10:36:48] willgriffiths1 at yahoo dot co dot uk

Description:
------------
I put PHP 5.3 because it made me pick a version. I'm actually using
PHP-GTK2.

The function in the example given echos the 'date' and the 'filesize'
every 3 seconds.

However, while the date updates correctly (+3 seconds each time), the
filesize stays the same even if you increase the size of the file.

Is this expected behaviour?

Reproduce code:
---------------
Gtk::timeout_add(3000, 'update', $store);

function update($store) {

$offset = filesize('file.txt') - 100;
echo $offset." ".date('H:i:s')."\r\n";

}

Expected result:
----------------
195382 11:18:06
195387 11:18:09
195399 11:18:12
...

Actual result:
--------------
195380 11:18:06
195380 11:18:09
195380 11:18:12
...



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=49466&edit=1


--
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php