I have a socket program that runs in an infinite loop, listening for connections, in this socket I have a method, that is supposed to open a file and write to the file, but I am having issues. Each call to the socket happens about once every 1.5 seconds, and then, it writes to the socket, but for some reason, filesize is always returning "0" even when the file is 1.5kb in size.
I use a string var to to defiine the file and it's positions:
var $file = 'C:php_filesPhediatest.flv';
Why is it returning 0? It writes to the file fine, so why cant it get the correct size?
this function is ran about every 1.5 seconds, it is supposed to append the new data to the current file:
function dataRecieved($allclient, $socket, $buf) {
echo filesize($this->file)."nn";
$this->handle = fopen($this->file, "a+b");
if(filesize($this->file) < 1){
$buf = "FLV".pack('C', 1).pack('C', 1).pack('N', 9).pack('N', 9).$buf;
}
if(fwrite($this->handle, $buf)){
echo "Wrote to filen";
echo $buf;
}
fclose($this->handle);
}
Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but eventually I had to give up Basically, I have a website that is based around manipulating photos with
Solution to the FindControl problem
I have seen may posts about having problems with the FindControl method. Most seem to come about because the control being searched for is nested within a container other than the webform.I came
Check if another session of the page is running?
I want to keep people from opening multiple tabs, or sessions of my Facebook app. Is it possible to check if a session is currently running of my app, like maybe using a cookie or something?
Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/In a nutshell it says XHTML is a big no-no for non-geeks when it comes to dynamic pages i.e. PHP.Do I sidestep XHTML
subtract 1 from value entered in text field
HiHow do I subtract 1 from the vaue entered into a text field?Thanks
finding key position of specified value in multi-dimensional array
Code: $openedfile = fopen($tfc_file4, "r");$rc = 1;while(!feof($openedfile)){$rc++;$hold[$rc] = explode("|" , trim(fgets($openedfile)));}fclose($openedfile);How can I loop through
Code working in IE but not FireFox
I created a dynamic navigation list for my website based off of a table in my database. The code is working perfectly in IE (I have version 8 on this computer) But it wont work on Firefox. I'm not
Results from Db outputted twice
Hey guys.. for come reason my data is outputted twise shown in the image below and i cant figure out why.Code: [Select]<html><head><title>Month
Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of information from a database query and puts it in a sortable, filterable table. This all works fine and
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I have a method, that is supposed to open a file and write to the file, but I am having issues. Each