fix cat bug
use absolute path
check if successfully create directory
use absolute directory by default
fix typo