feat(file): support filling the file content

Added assign_blocks and finalize_file.  Some sophisticated error
handling are needed.