You are here

function _backup_migrate_bzip_decode in Backup and Migrate 5.2

Bzip decode a file.

1 call to _backup_migrate_bzip_decode()
backup_migrate_file_decompress in includes/files.inc
Decompress a file with the given settings. Also updates settings to reflect new file mime and file extension.

File

includes/files.inc, line 290
General file handling code for Backup and Migrate.

Code

function _backup_migrate_bzip_decode($source, $dest) {
  $success = FALSE;
  if (@function_exists("bzopen")) {
    if (($fp_out = fopen($dest, 'w')) && ($fp_in = bzopen($source, 'rb'))) {
      while (!feof($fp_in)) {
        fwrite($fp_out, gzread($fp_in, 1024 * 512));
      }
      $success = TRUE;
    }
    else {
      $error = TRUE;
    }
    @bzclose($fp_in);
    @fclose($fp_out);
  }
  return $success;
}