update the structure of cfg file
add getRouter and writeRouter
general file operation