http://pastebin.com/ardzHaUh
See lines 392 - 398
Code: Select all
<?php
include("scan_ips_class.php");
$scanIPs = new Scan_ips;
?>Warning: fseek(): 5 is not a valid stream resource in P:\server\scan_ips\scan_ips_class.php on line 402
Whilst I understand that the file hanlder is not valid, I cannot find out why it is not valid.
There is this line:
if ( !$this->FRWBHandler )
$this->FRWBHandler = @fopen($this->file,"r+b");
which should set the file hanlder. In fact, I see that the file handle is set, because I print it by echo. If I will add this line:
Code: Select all
$this->FRWBHandler = @fopen($this->file,"r+b");Just to explain what I do in the class:
I add IPs into file, but before I add it I want to check if it already exist or not, so I run function to check it. So if I call the check, the file will be opened so I won't need to close it and then reopen it again. This is why I added the shared file handler called $this->FRWBHandler
So my question is what is wrong that is does not work as I expect. Either it will not accept the resource (resource 5) or it will generate new resources If I will ignore that the resource is already opened.