Current Location: Home> Function Categories> set_file_buffer

set_file_buffer

alias for stream_set_write_buffer
Name:set_file_buffer
Category:File system
Programming Language:php
One-line Description:Sets the buffer size of the opened file.

Definition and usage

set_file_buffer() function sets the buffer size of the open file.

If successful, the function returns 0. If it fails, return EOF.

Example

Create unbuffered streams:

 <?php
$file = fopen ( "test.txt" , "w" ) ;
if ( $file )
  {
  set_file_buffer ( $file , 0 ) ;
  fwrite ( $file , "Hello World. Testing!" ) ;
  fclose ( $file ) ;
  }
?>

grammar

 set_file_buffer ( file , buffer )
parameter describe
file Required. Specifies the file to be opened.
Buffer Required. Specify the buffer size, measured in bytes.
Similar Functions
  • Format input from a file fscanf

    fscanf

    Formatinputfromafile
  • Lightweight consultation file locking flock

    flock

    Lightweightconsultat
  • Read a line from the file pointer and parse the CSV field fgetcsv

    fgetcsv

    Readalinefromthefile
  • Create a hard connection link

    link

    Createahardconnectio
  • Close an open file pointer fclose

    fclose

    Closeanopenfilepoint
  • Read the entire file into an array file

    file

    Readtheentirefileint
  • Read characters from file pointer fgetc

    fgetc

    Readcharactersfromfi
  • Read files (safely used in binary files) fread

    fread

    Readfiles(safelyused
Popular Articles