0

I need to check if the file size has changed via timer but it returns still the same size even though the file is bigger.

Timer is set correctly, everything should be fine, but it is not.

I tried giving the file size to a variable, to a function even put directly the filesize(path/to/file) but nothing worked, it always returns zero size (which it is initially).

I also tried giving the file some content from beginning and then it returned the right size, but when the size changed, it still returned the original size.

Here is the part of code responsible for checking:

case ID_TIMER:
    $filesize = filesize(cesta."/db/scanned.txt");
    if($filesize > $filesize_last) {
      wb_message_box($window,"Zvětšeno","Test");
    }
    break;
Rikudou_Sennin
  • 1,357
  • 10
  • 27

1 Answers1

0

So, if anyone will also look for this, I made a workaround.

The Winbinder does not work with filesize from unknown reasons, so there's needed to use something like

strlen(file_get_contents(cesta."/db/scanned.txt"));

Which works just fine.

Rikudou_Sennin
  • 1,357
  • 10
  • 27