Add a flag to print directories as files

Also, re-use the stat result from directory-checking.
from_buf -> String::from_raw_buf
Fix bug where header line would appear twice