tacker

a simple web bundler
git clone https://tongong.net/git/tacker.git
Log | Files | Refs | README

bundle_binary.ha (273B)


      1 use encoding::base64;
      2 use io;
      3 use os;
      4 
      5 fn tacker_binary(inputpath: str, ofile: io::handle) void = {
      6 	const ifile = os::open(inputpath)!;
      7 	defer io::close(ifile)!;
      8 	const enc = base64::newencoder(&base64::std_encoding, ofile);
      9 	io::copy(&enc, ifile)!;
     10 	io::close(&enc)!;
     11 };