saves total file length in metadata file.