Skip to content
FutureBlitz

    Install

    Import std.compress.vfs

    Vfs

    std.compress.vfs

    extend

    Extend Vfs

    Mounting a zip in a Vfs, as its files.

    std/compress/vfs.fb, line 106

    • @PanicsAtCaller Public Method MountZip(at: Path, data: UInt8[]) Throws IOError method #

      Mounts the zip in data, which it copies, at at, as a ZipSource. Throws an IOError of INVALID_DATA when the data isn't a zip, or ends early, or as a ZipSource does, and panics for a path that goes above the root, as Mount does.

      Examples

      Local zip = ZipWriter()
      zip.Add("levels/one.txt", "first".Bytes)
      Local files = Vfs()
      Try files.MountZip(Path("data"), zip.Finish())
      Expect(Try files.ReadText(Path("data/levels/one.txt")) == "first")
      Expect(files.DirExists(Path("data/levels")))

    Report an issue with this page or with FutureBlitz on GitHub.