bitcoin-block 0.1.16-alpha.0

blocks
Documentation
crate::ix!();

#[cfg(WIN32)]
pub fn truncate_file(
        file:   *mut libc::FILE,
        length: u32) -> bool {
    
    chsize(fileno(file),length) == 0
}

#[cfg(not(WIN32))]
pub fn truncate_file(
        file:   *mut libc::FILE,
        length: u32) -> bool {
    
    unsafe {
        ftruncate(libc::fileno(file),length.into()) == 0
    }
}