c:copy command and links

A forum for general AmigaOS 4.x support questions that are not platform-specific

c:copy command and links

Postby MichaelMerkel » Sat Jul 16, 2011 3:14 pm

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
MichaelMerkel
Beta Tester
Beta Tester
 
Posts: 340
Joined: Mon Dec 20, 2010 3:08 pm
Location: Germany

Re: c:copy command and links

Postby nbache » Sun Jul 17, 2011 12:14 am

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
nbache
Beta Tester
Beta Tester
 
Posts: 1387
Joined: Mon Dec 20, 2010 8:25 pm
Location: Copenhagen, Denmark

Re: c:copy command and links

Postby ChrisH » Sun Jul 17, 2011 1:39 pm

I wrote my own command to backup hard/soft links (and optionally other Amiga-specific stuff like comments)...
User avatar
ChrisH
Beta Tester
Beta Tester
 
Posts: 915
Joined: Mon Dec 20, 2010 10:09 pm

Re: c:copy command and links

Postby nexus » Tue Jul 19, 2011 7:20 am

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
nexus
Beta Tester
Beta Tester
 
Posts: 347
Joined: Mon Dec 20, 2010 3:11 pm
Location: Germany

Re: c:copy command and links

Postby MichaelMerkel » Tue Jul 19, 2011 12:04 pm

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: 340
Joined: Mon Dec 20, 2010 3:08 pm
Location: Germany

Re: c:copy command and links

Postby MichaelMerkel » Tue Jul 19, 2011 8:06 pm

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
MichaelMerkel
Beta Tester
Beta Tester
 
Posts: 340
Joined: Mon Dec 20, 2010 3:08 pm
Location: Germany

Re: c:copy command and links

Postby OldFart » Fri Aug 19, 2011 12:45 pm

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

I therefore mostly use WB's copy.

OldFart
Sleeping X5000, eagerly awaiting awakening
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 (for sale, willing to split)
RaspBerry Pi 2B, 3B & 4B (4Gb)
User avatar
OldFart
 
Posts: 54
Joined: Tue Jul 12, 2011 3:56 pm
Location: Groningen, Netherlands

Re: c:copy command and links

Postby Raziel » Fri Aug 19, 2011 6:35 pm

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 :-)
If slaughterhouses had glass walls, everyone would be a vegetarian. ~ Sir Paul McCartney
-
Did everything just taste purple for a second? ~ Philip J. Fry
-
Ain't got no cash, ain't got no style, ladies vomit when I smile. ~ Dr. John Zoidberg
User avatar
Raziel
 
Posts: 924
Joined: Sat Jun 18, 2011 5:00 pm
Location: a story that hasn't been written yet

Re: c:copy command and links

Postby MichaelMerkel » Sat Aug 20, 2011 9:47 pm

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)
User avatar
MichaelMerkel
Beta Tester
Beta Tester
 
Posts: 340
Joined: Mon Dec 20, 2010 3:08 pm
Location: Germany

Re: c:copy command and links

Postby xenic » Sun Aug 21, 2011 2:39 am

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
xenic
 
Posts: 1160
Joined: Sun Jun 19, 2011 1:06 am

Next

Return to General AmigaOS

Who is online

Users browsing this forum: No registered users and 4 guests