scan dir
write with dir