PHP set_file_buffer() Function
Complete PHP Filesystem Reference
Definition and Usage
The set_file_buffer() function sets the buffer size of an open
file.
Output using fwrite() is normally buffered at 8K. So, if two processes
writes to the same file, each will write up to 8K
before pausing, and allow the other to write. If buffer is 0, write operations are unbuffered
(meaning that the first write process will be completed before allowing other
processes to write).
This function returns 0 on success, otherwise it returns EOF.
Syntax
set_file_buffer(file,buffer)
|
Parameter |
Description |
file |
Required. Specifies the open file |
buffer |
Required. Specifies the buffer size in bytes |
Tips and Notes
Tip: This function is an alias of stream_set_write_buffer().
Example
Create an unbuffered stream:
<?php
$file = fopen("test.txt","w");
if ($file)
{
set_file_buffer($file,0);
fwrite($file,"Hello World. Testing!");
fclose($file);
}
?>
|
Complete PHP Filesystem Reference
Learn how your website performs under various load conditions
|
|
WAPT
is a load, stress and performance testing tool for websites and web-based applications.
In contrast to "800-pound gorilla" load testing tools, it is designed to minimize the learning
curve and give you an ability to create a heavy load from a regular workstation.
WAPT is able to generate up to 3000 simultaneously acting virtual users using standard hardware configuration.
Virtual users in each profile are fully customizable. Basic and NTLM authentication methods are supported.
Graphs and reports are shown in real-time at different levels of detail, thus helping to manage the testing process.
Download the free 30-day trial!
|
|