Dir::foreach("idx"){|idx_f|
idxName = idx_f.split(".")[0]
deleteFlag=True
Dir::foreach("dat"){|dat_f|
datName = dat_f.split(".")[0]
if(datName==idxName){
deleteFrag = false
}
}
if(deleteFlag){
File.delete(idx_f)
}
}
Dir::foreach("idx"){|idx_f|
idxName = idx_f.split(".")[0]
deleteFlag=True
Dir::foreach("dat"){|dat_f|
datName = dat_f.split(".")[0]
if(datName==idxName){
deleteFrag = false
}
}
if(deleteFlag){
File.delete(idx_f)
}
}