Apologies for the stupid question! Does anyone know how to copy without overwriting a file in OpenWRT? The cp command in OpenWRT appears to have limited options and lacks the required option to not overwrite files!
I can easily check if the file exists in Lua, but this is yet another time consuming task that I’d prefer to avoid if the OS can do this.
Thanks fuztle,
Yes, I was after the -n option. -i says it prompts for overwrite, which isn’t quite what I’m after. That said, I’ve not tried it from Lua, but I assume it will simply never return if run from os.execute().
It’s strange that there’s an “overwrite” option (-f), but cp seems to do this already by default!