public function getWroteBlocks()
    {
        if (!is_dir($this->blocks)) {
            throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
        }
        $files = array_filter(array_map(function($file) {
            $basename = basename($file);
            if (!is_numeric($basename)) {
                return false;
            }
            return [
                'offset' => (int)$basename,
                'file' => $file,
                'size' => filesize($file)
            ];
        }, glob($this->blocks . "*")));

        uasort($files, function($a, $b) {
            return $a['offset'] - $b['offset'];
        });

        return $files;
    }
public function getWroteBlocks()
    {
        if (!is_dir($this->blocks)) {
            throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
        }
        $files = array_filter(array_map(function($file) {
            $basename = basename($file);
            if (!is_numeric($basename)) {
                return false;
            }
            return [
                'offset' => (int)$basename,
                'file' => $file,
                'size' => filesize($file)
            ];
        }, glob($this->blocks . "*")));

        uasort($files, function($a, $b) {
            return $a['offset'] - $b['offset'];
        });

        return $files;
    }
public function getWroteBlocks ( ) { if ( ! is_dir ( $ this -> blocks ) ) { throw new RuntimeException ( "cannot obtain the blocks ({$this->blocks})" ) ; } $ files = array_filter ( array_map ( function ( $ file ) { $ basename = basename ( $ file ) ; if ( ! is_numeric ( $ basename ) ) { return false ; } return [ 'offset' => ( int ) $ basename , 'file' => $ file , 'size' => filesize ( $ file ) ] ; } , glob ( $ this -> blocks . "*" ) ) ) ; uasort ( $ files , function ( $ a , $ b ) { return $ a [ 'offset' ] - $ b [ 'offset' ] ; } ) ; return $ files ; }
Returns all the wrote blocks of files. All the blocks are sorted by their offset.

@return array
Returns all the wrote blocks of files . All the blocks are sorted by their offset .