(filetype (car (file-attributes file))))
(cond
((eq filetype t) ; Directory but not a symlink.
- (copy-directory file newname keep-time parents))
+ (copy-directory file target keep-time parents t))
((stringp filetype) ; Symbolic link
(make-symbolic-link filetype target t))
((copy-file file target t keep-time)))))
(dirname (file-name-as-directory dir))
(source (concat dirname "source"))
(dest (concat dirname "dest/new/directory/"))
- (file (concat (file-name-as-directory source) "file")))
+ (file (concat (file-name-as-directory source) "file"))
+ (source2 (concat dirname "source2"))
+ (dest2 (concat dirname "dest/new2")))
(make-directory source)
(write-region "" nil file)
(copy-directory source dest t t t)
(should (file-exists-p (concat dest "file")))
+ (make-directory (concat (file-name-as-directory source2) "a") t)
+ (copy-directory source2 dest2)
+ (should (file-directory-p (concat (file-name-as-directory dest2) "a")))
(delete-directory dir 'recursive)))
(provide 'files-tests)