c:copy command and links

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
MichaelMerkel
Beta Tester
Beta Tester
Posts: 355
Joined: Mon Dec 20, 2010 2:08 pm
Location: Germany
Contact:

c:copy command and links

Post 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
Michael Merkel :lol:
(Member of Amiga Freunde Pfalz)
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1714
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: c:copy command and links

Post 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
User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 920
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: c:copy command and links

Post by ChrisH »

I wrote my own command to backup hard/soft links (and optionally other Amiga-specific stuff like comments)...
User avatar
nexus
Beta Tester
Beta Tester
Posts: 347
Joined: Mon Dec 20, 2010 2:11 pm
Location: Germany

Re: c:copy command and links

Post 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.
User avatar
MichaelMerkel
Beta Tester
Beta Tester
Posts: 355
Joined: Mon Dec 20, 2010 2:08 pm
Location: Germany
Contact:

Re: c:copy command and links

Post 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
Michael Merkel :lol:
(Member of Amiga Freunde Pfalz)
User avatar
MichaelMerkel
Beta Tester
Beta Tester
Posts: 355
Joined: Mon Dec 20, 2010 2:08 pm
Location: Germany
Contact:

Re: c:copy command and links

Post 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
Michael Merkel :lol:
(Member of Amiga Freunde Pfalz)
User avatar
OldFart
Posts: 100
Joined: Tue Jul 12, 2011 2:56 pm
Location: Groningen, Netherlands

Re: c:copy command and links

Post by OldFart »

Copying a directory per workbench works perfect! Indeed C:Copy exempts links from copying.

I therefore mostly use WB's copy.

OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: c:copy command and links

Post 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 :-)
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
MichaelMerkel
Beta Tester
Beta Tester
Posts: 355
Joined: Mon Dec 20, 2010 2:08 pm
Location: Germany
Contact:

Re: c:copy command and links

Post 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
Michael Merkel :lol:
(Member of Amiga Freunde Pfalz)
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: c:copy command and links

Post 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.
AmigaOne X1000 with 2GB memory - OS4.1 FE
Post Reply