Copy md and ln for write() based output