/write_file.php

Description

This script implements an overly careful file writing function, which can be used to safely write files disk, without risking problems due to crashed scripts or full disks.

  • license: Phorum
  • copyright: 2007, Phorum Development Team
Functions
phorum_api_write_file (line 52)

This function can be used to safely write a file to disk.

For writing the file, a swap file is used during the write phase. Only if writing the swap file fully succeeded without running into errors, the swap file is moved to its final location. This way, we cannot get broken data because of scripts that crash during writing or because of disks that are full.

  • return: TRUE in case the file was written successfully to disk. FALSE if writing the file failed. The function phorum_api_strerror() can be used to retrieve information about the error which occurred.
boolean phorum_api_write_file (mixed $file, mixed $data, string $file , string $data )
  • string $file : The name of the file to write to.
  • string $data : The data to put in the file.

Documentation generated on Wed, 07 Nov 2007 08:45:31 -0600 by phpDocumentor 1.3.0RC5