Page 1 of 3

c:copy command and links

Posted: Sat Jul 16, 2011 2:14 pm
by MichaelMerkel
hi.

the c:copy command is not able to copy links. maybe this can be added? uisng the workbench for copying this works.

there exists the COPYLINKS arcgument and the FOLLOWLINKS argument. but a "keeplink" (or whatever) is missing.

btw. i personally would expect that a
copy #? TO whatever: ALL CLONE
really copies everything so that the target folder looks identical to the source one. so a "keelinks" should be the default if possible.

i just found this annoying when i reformated some of my partitions. i copied the content before to an empty partition and back afterwards. but lost the links in sobj: for example. :oops:

thanks and regards
michael

Re: c:copy command and links

Posted: Sat Jul 16, 2011 11:14 pm
by nbache
I agree, I'd like this too. It has been discussed before, AFAIR.

It is not so simple, though, as it would also have to be checked whether the target of the link is inside or outside the directory hierarchy being copied. If inside, the link must be created after the target has been created in the copy (unless it's a soft link), so an extra pass/step is necessary. I'm not sure whether Workbench handles this?

But of course it could be done, conceptually. Whether it is feasible reasonably to make the existing copy command do it, I don't know.

Best regards,

Niels

Re: c:copy command and links

Posted: Sun Jul 17, 2011 12:39 pm
by ChrisH
I wrote my own command to backup hard/soft links (and optionally other Amiga-specific stuff like comments)...

Re: c:copy command and links

Posted: Tue Jul 19, 2011 6:20 am
by nexus
With 'cp -a <src> <dst>' from SDK does what you want to do, or am I wrong? :)

nexus

P.S. With long filenames and weird characters in files, the AmigaOS Copy Command has problems, too, as far as I remember. I usually prefere using 'cp' for this reason.

Re: c:copy command and links

Posted: Tue Jul 19, 2011 11:04 am
by MichaelMerkel
nexus wrote:With 'cp -a <src> <dst>' from SDK does what you want to do, or am I wrong? :)

nexus

P.S. With long filenames and weird characters in files, the AmigaOS Copy Command has problems, too, as far as I remember. I usually prefere using 'cp' for this reason.
never tried that! i'll check - thanks!

regards...
michael

Re: c:copy command and links

Posted: Tue Jul 19, 2011 7:06 pm
by MichaelMerkel
nexus wrote:With 'cp -a <src> <dst>' from SDK does what you want to do, or am I wrong? :)
:mrgreen:

thank you so much! that's working perfect. super!
nevertheless should the original copy command be enhanced. expecially because it is faster.

thanks and regards
michael

Re: c:copy command and links

Posted: Fri Aug 19, 2011 11:45 am
by OldFart
Copying a directory per workbench works perfect! Indeed C:Copy exempts links from copying.

I therefore mostly use WB's copy.

OldFart

Re: c:copy command and links

Posted: Fri Aug 19, 2011 5:35 pm
by Raziel
nexus wrote:With 'cp -a <src> <dst>' from SDK does what you want to do, or am I wrong? :)

nexus

P.S. With long filenames and weird characters in files, the AmigaOS Copy Command has problems, too, as far as I remember. I usually prefere using 'cp' for this reason.
Mate...thank you

I was looking for a solution myself for ages :-)

Re: c:copy command and links

Posted: Sat Aug 20, 2011 8:47 pm
by MichaelMerkel
MichaelMerkel wrote:
nexus wrote:With 'cp -a <src> <dst>' from SDK does what you want to do, or am I wrong? :)
:mrgreen:

thank you so much! that's working perfect. super!
nevertheless should the original copy command be enhanced. expecially because it is faster.
... and one problem with the "cp" command... the "S" flag is not copied. suddenly some scripts did not work. and that was caused by the former "cp"...

regards...
michael

Re: c:copy command and links

Posted: Sun Aug 21, 2011 1:39 am
by xenic
nbache wrote:But of course it could be done, conceptually. Whether it is feasible reasonably to make the existing copy command do it, I don't know.
Links (at least soft links) get copied with a WorkBench drag-n-drop copy. Maybe the problem is in dos.library rather than the copy command because Dopus4 botches links too. I tried the OS3 copy command but it copies the soft links as directories! Apparently, "cp" works but doesn't handle all the protection bits correctly. If the OS is going to use links (SOBJS directory & SDK:gcc/bin directory) we should at least get a copy command that copies them properly. Some of us actually back up our partitions on a regular basis and prefer that the links are there if a restore is necessary.