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
  • Write data to a file file_put_contents

    file_put_contents

    Writedatatoafile
  • Provide information about the document stat

    stat

    Provideinformationab
  • Export buffered content to file fflush

    fflush

    Exportbufferedconten
  • Rewind the file pointer position rewind

    rewind

    Rewindthefilepointer
  • Returns the normalized absolute path name realpath

    realpath

    Returnsthenormalized
  • Set file access and modification time touch

    touch

    Setfileaccessandmodi
  • Change file mode chmod

    chmod

    Changefilemode
  • alias for fwrite fputs

    fputs

    aliasforfwrite
Popular Articles