fix issue of file copy ignored in append mode
add comments
support wildcard