★ wanayoo — archive 1999 http://fr.php.net/manual/it/function.set-file-buffer.phpNouvelle recherche | Portail wanayoo
PHP Tuesday, March 20, 2001  
downloads | documentation | faq | support | reporting bugs | links 

search for in the  

lookup:
Manuale PHPManuale PHP
FilesystemFilesystem
 basenamebasename
 chgrpchgrp
 chmodchmod
 chownchown
 clearstatcacheclearstatcache
 copycopy
 deletedelete
 dirnamedirname
 diskfreespacediskfreespace
 fclosefclose
 feoffeof
 fflushfflush
 fgetcfgetc
 fgetcsvfgetcsv
 fgetsfgets
 fgetssfgetss
 filefile
 file_existsfile_exists
 fileatimefileatime
 filectimefilectime
 filegroupfilegroup
 fileinodefileinode
 filemtimefilemtime
 fileownerfileowner
 filepermsfileperms
 filesizefilesize
 filetypefiletype
 flockflock
 fopenfopen
 fpassthrufpassthru
 fputsfputs
 freadfread
 fscanffscanf
 fseekfseek
 fstatfstat
 ftellftell
 ftruncateftruncate
 fwritefwrite
 set_file_bufferset_file_buffer
 is_diris_dir
 is_executableis_executable
 is_fileis_file
 is_linkis_link
 is_readableis_readable
 is_writeableis_writeable
 is_uploaded_fileis_uploaded_file
 linklink
 linkinfolinkinfo
 mkdirmkdir
 move_uploaded_filemove_uploaded_file
 pclosepclose
 popenpopen
 readfilereadfile
 readlinkreadlink
 renamerename
 rewindrewind
 rmdirrmdir
 statstat
 lstatlstat
 realpathrealpath
 symlinksymlink
 tempnamtempnam
 tmpfiletmpfile
 touchtouch
 umaskumask
 unlinkunlink

previousfwrite
is_dirnext

Last updated: Sat, 17 Mar 2001
view this page in English | Brazilian Portuguese | Czech | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Spanish | Plain HTML

set_file_buffer

(PHP 3>= 3.0.8, PHP 4 >= 4.0.1)

set_file_buffer --  Sets file buffering on the given file pointer

Description

int set_file_buffer (int fp, int buffer)

Output using fwrite() is normally buffered at 8K. This means that if there are two processess wanting to write to the same output stream (a file), each is paused after 8K of data to allow the other to write. set_file_buffer() sets the buffering for write operations on the given filepointer fp to buffer bytes. If buffer is 0 then write operations are unbuffered. This ensures that all writes with fwrite() are completed before other processes are allowed to write to that output stream.

The function returns 0 on success, or EOF if the request cannot be honored.

The following example demonstrates how to use set_file_buffer() to create an unbuffered stream.

Esempio 1. set_file_buffer() example


$fp=fopen($file, "w");
if($fp){
  set_file_buffer($fp, 0);
  fputs($fp, $output);
  fclose($fp);
}
      

See also fopen(), fwrite().

previousfwrite
is_dirnext

Last updated: Sat, 17 Mar 2001
add note | about notes

show source | credits | mirror sites:  

Copyright © 1998-2001 The PHP Group
All rights reserved.
This mirror generously provided by: L'Université Michel de Montaigne Bordeaux III
Last updated: Tue Mar 20 08:31:17 2001 MET