function Archive_Tar::addString

7.x system.tar.inc Archive_Tar::addString($p_filename, $p_string)

This method add a single string as a file at the end of the existing archive. If the archive does not yet exists it is created.

@access public

Parameters

string $p_filename A string which contains the full: filename path that will be associated with the string.

string $p_string The content of the file added in: the archive.

Return value

true on success, false on error.

File

drupal-7.x/modules/system/system.tar.inc, line 438

Class

Archive_Tar
Creates a (compressed) Tar archive *

Code

function addString($p_filename, $p_string) 
 {
  $v_result = true;

  if (!$this->_isArchive()) {
    if (!$this->_openWrite()) {
      return false;
    }
    $this->_close();
  }

  if (!$this->_openAppend()) {
    return false;
  }

  // Need to check the get back to the temporary file ? ....
  $v_result = $this->_addString($p_filename, $p_string);

  $this->_writeFooter();

  $this->_close();

  return $v_result;
}