rename struct block to Block
add Open flag and mode
fix compile error