@param [Proc] block the block for initialize
 Save as ePub file

 @param [String] filename the ePub file name to save
344864
def save(filename)
      Dir.mktmpdir do |dir|
        prepare(dir)

        NCX.new(
          :uid => @uid,
          :title => @titles[0],
          :nav => @nav
        ).save(File.join(dir, @ncx_file))

        OPF.new(
          :title => @titles,
          :identifier => @identifiers,
          :creator => @creators,
          :publisher => @publishers,
          :date => @dates,
          :language => @languages,
          :subject => @subjects,
          :description => @descriptions,
          :rights => @rightss,
          :relation => @relations,
          :manifest => @files.map{|i| File.basename(i)},
          :ncx => @ncx_file
        ).save(File.join(dir, @opf_file))

        OCF.new(
          :dir => dir,
          :container => @opf_file
        ).save(filename)
      end
    end
988075
def save(self, name):
        
        self.finalize()
        with open(name, 'wb+') as f:
            if six.PY3:
                f.write(self.fileobj.getbuffer())
            else:
                f.write(self.fileobj.getvalue().encode('utf-8'))
247494
def make_runfile(name=nil)
      name = 'Runfile' if name.nil?
      template = File.expand_path("../templates/Runfile", __FILE__)
      name += ".runfile" unless name == 'Runfile'
      dest = "#{Dir.pwd}/#{name}"
      begin
        File.write(dest, File.read(template))
        puts "#{name} created."
      rescue => e
        abort "Failed creating #{name}\n#{e.message}"
      end
    end
546044
def create
      @block = Block.builder(params)

      if @block.save
        render json: { status: :success }, status: :ok
      else
        render json: @block.errors, status: :unprocessable_entity
      end
    end
952212
public void saveAs(final String filename, final ZipUTF8WriterBuilder builder)
            throws IOException {
        try {
            final FileOutputStream out = new FileOutputStream(filename);
            final ZipUTF8Writer writer = builder.build(out);
            try {
                this.save(writer);
            } finally {
                writer.close();
            }
        } catch (final FileNotFoundException e) {
            this.logger.log(Level.SEVERE, "Can't open " + filename, e);
            throw new IOException(e);
        }
    }
448572
def save(self, filename):
        ''''''
        try:
            f = open(filename, mode='w')
        except Exception:
            return False
        for k in self.list():
            f.write("%s=%s\n" % (k, self.get(k)))
        f.close()
        return True
105033
void storeBlock(BlockId blockId, ByteBuffer block) throws IOException {
        synchronized (m_accessLock) {
            if (m_blockPathMap.containsKey(blockId)) {
                throw new IllegalArgumentException("Request to store block that is already stored: "
                                                    + blockId.toString());
            }

            int origPosition = block.position();
            block.position(0);
            Path blockPath = makeBlockPath(blockId);
            try (SeekableByteChannel channel = Files.newByteChannel(blockPath, OPEN_OPTIONS, PERMISSIONS)) {
                channel.write(block);
            }
            finally {
                block.position(origPosition);
            }

            m_blockPathMap.put(blockId, blockPath);
        }
    }
286093
def save(self, filename):
        
        clibrebound.reb_output_binary(byref(self), c_char_p(filename.encode("ascii")))
1333162
def write(self, block):
        
        self.fileobj.write(block)
        self.status.update(len(block))
977219
def save(self, name):
        
        with open(name, 'wb+') as f:
            while True:
                buf = self._fileobj.read()
                if not buf:
                    break
                f.write(buf)
182858
def write(self, file_or_filename):
        
        self.book = Workbook()
        self._write_data(None)
        self.book.save(file_or_filename)
653714
def save(self, filename):
        
        with open(filename, 'wb') as fp:
            writer = BlockWriter()
            factory = BlockFactory()

            preamble_dummy_bytes = bytearray([0] * 9)
            preamble = bread.parse(
                preamble_dummy_bytes, spec.lsdsng_preamble)
            preamble.name = self.name
            preamble.version = self.version

            preamble_data = bread.write(preamble)
            raw_data = self.get_raw_data()
            compressed_data = filepack.compress(raw_data)

            writer.write(compressed_data, factory)

            fp.write(preamble_data)

            for key in sorted(factory.blocks.keys()):
                fp.write(bytearray(factory.blocks[key].data))
588915
def process_proc(proc_obj, context=nil, filename=nil)
      if context.is_a?(Binding)
        filename ||= '(erubis)'
        return eval(proc_obj, context, filename)
      else
        context = Context.new(context) if context.is_a?(Hash)
        return context.instance_eval(&proc_obj)
      end
    end
502797
def save(self, filename, strip_prefix=''):
        
        arg_dict = {}
        for param in self.values():
            weight = param._reduce()
            if not param.name.startswith(strip_prefix):
                raise ValueError(
                    "Prefix '%s' is to be striped before saving, but Parameter's "
                    "name '%s' does not start with '%s'. "
                    "this may be due to your Block shares parameters from other "
                    "Blocks or you forgot to use 'with name_scope()' when creating "
                    "child blocks. For more info on naming, please see "
                    "http://mxnet.incubator.apache.org/tutorials/basic/naming.html"%(
                        strip_prefix, param.name, strip_prefix))
            arg_dict[param.name[len(strip_prefix):]] = weight
        ndarray.save(filename, arg_dict)
469144
function startFile() {
      saveBlock();
      saveFile();

      currentFile = {};
      currentFile.blocks = [];
      currentFile.deletedLines = 0;
      currentFile.addedLines = 0;
    }
173157
def register_filter_encoder encoder = nil, &block
      if !encoder.nil? && encoder.is_a?(Proc)
        @filter_codec[:encoder] = encoder
      elsif block_given?
        @filter_codec[:encoder] = block
      end
      save
    end
271158
BlockId append(String fileName, IoBuffer buffer) {
		try {
			IoChannel fileChannel = getFileChannel(fileName);

			// Rewind the buffer for writing
			buffer.rewind();

			// Append the block to the file
			long newSize = fileChannel.append(buffer);

			// Return the new block id
			return new BlockId(fileName, newSize / BLOCK_SIZE - 1);

		} catch (IOException e) {
			e.printStackTrace();
			return null;
		}
	}