Skip to content

AddFile Method ​

Definition ​

  • Namespace: JASE
  • Assembly: JASE.Compression.dll

bool AddFile(string name, byte[] content) ​

csharp
bool AddFile(string name, byte[] content)

Adds or replaces a file entry in the current tarball.

Parameters ​

NameDescription
contentThe file contents as a byte array. A value is treated as an empty file when the tar is generated.
nameThe file name to use inside the tar archive. This is written into the tar header and should be a relative path (e.g. "folder/file.txt").

Returns ​

if the file name is non-empty and the entry is added to the tarball; otherwise .

Remarks ​

If a file with the same name already exists, it is overwritten with the new content.