I've been copying some executable files and noticed the permission flags are getting dropped on a copy. It would be nice if the library defaulted to maintaining file flags.
My workaround:
(defn copy-permissions [from to]
(when (fs/executable? from)
(fs/chmod "+x" to))
(when (fs/writeable? from)
(fs/chmod "+w" to))
(when (fs/readable? from)
(fs/chmod "+r" to)))
(defonce _|HACK_TOWN
(alter-var-root #'fs/copy
(fn [old]
(fn [from to]
(old from to)
(copy-permissions from to)))))
Happy to turn it into a PR if others are in agreement about the change in functionality.
I've been copying some executable files and noticed the permission flags are getting dropped on a copy. It would be nice if the library defaulted to maintaining file flags.
My workaround:
Happy to turn it into a PR if others are in agreement about the change in functionality.