overriding FileReference>>copyTo: behavior
Hi, is there an API to copy a file that will override the target destination if it already exists? I was quite surprised that #copyTo: (and #copyAllTo:) will throw up when the target file already exists. Do I need to explicitly remove the file before copying / copy the contents instead? Thanks, Peter
Ideally something that works as updater only (doesn't touch nor change modification time if the contents is the same) On Mon, Sep 17, 2018 at 1:16 PM Peter Uhnak <i.uhnak@gmail.com> wrote:
Hi,
is there an API to copy a file that will override the target destination if it already exists? I was quite surprised that #copyTo: (and #copyAllTo:) will throw up when the target file already exists.
Do I need to explicitly remove the file before copying / copy the contents instead?
Thanks, Peter
target exists ifFalse: [ source copyTo: target ] ?
On 17 Sep 2018, at 13:27, Peter Uhnak <i.uhnak@gmail.com> wrote:
Ideally something that works as updater only (doesn't touch nor change modification time if the contents is the same)
On Mon, Sep 17, 2018 at 1:16 PM Peter Uhnak <i.uhnak@gmail.com> wrote: Hi,
is there an API to copy a file that will override the target destination if it already exists? I was quite surprised that #copyTo: (and #copyAllTo:) will throw up when the target file already exists.
Do I need to explicitly remove the file before copying / copy the contents instead?
Thanks, Peter
participants (2)
-
Peter Uhnak -
Sven Van Caekenberghe