[][src]Function phar::create

pub fn create<W: Read + Write + Seek>(
    stream: W,
    signature: Signature
) -> NeedStub<W>

Creates a phar file.

The stream must support random-access read AND write. When passing fs::File, it should be created with fs::OpenOptions::new().read(true).write(true).create(true), optionally with truncate(true) as well.

For performance reasons, the name and metadata of all entries must be known at the beginning before writing any file content. Editing previous writes is not supported, because that would require repacking all subsequent contents.