implement dirdopack & dirunpack functions