Copy Command glitches

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Copy Command glitches

Post by Amigo1 »

Hello


Unless I'm doing something wrong, here two issues with the copy command.
Maybe someone can please check and try to reproduce.

1) First the FOLLOWLINKS option.

create a test-folder in RAM: or any other drive, a folder within this folder and a link which point to this folder. Some duplicate text files are in those folders and a link pointig to another folder in the root of the drive.

# Here the steps:

Code: Select all

CD RAM:
MAKEDIR Destination_Drawer1 Test_Drawer/Destination_Drawer2 ALL
ECHO "Hello" to RAM:destination_drawer1/textfile_in_destination_drawer1.txt
ECHO "Hello" to RAM:Test_Drawer/textfile_in_test_Drawer
ECHO "Hello" to RAM:Test_Drawer/Destination_Drawer2/textfile_in_destination_Drawer2
MAKELINK test_drawer/link_to_destination_drawer1 ram:Destination_Drawer1 SOFT
MAKELINK test_drawer/link_to_destination_drawer2 ram:test_Drawer/destination_drawer2 SOFT
resulting directory tree:
  • RAM:
    |- destination_Drawer1
    ||- textfile_in_destination_Drawer1.txt
    |- test_Drawer
    ||- textfile_in_test_Drawer
    ||- destination_Drawer2
    |||- text_file_in_destination_Drawer2
    ||- link_to_destination_Drawer1
    ||- link_to_destination_Drawer2
and then

Code: Select all

COPY RAM:Test_Drawer to Work:Test_Drawer_Copy ALL CLONE FOLLOWLINKS
resulting directory tree in Work:
  • Work:
    |-Test_Drawer_Copy
    ||-Destination_Drawer2
    ||-Text_file_in_test_drawer
#End steps glitch 1

If I understood correctly what the FOLLOWLINKS option should do, then at least the "link_to_destination_Drawer2"
should have been created.

2) the NOREQ Option

I can't make COPY to open a requester, not from a Shell, nor from a script, regardless what I throw at it, so the NOREQ Option has no function here.
Normally, COPY displays a requester if the COPY cannot continue for
some reason. When the NOREQ option is given, all requesters are
suppressed. This is useful in scripts and can prevent a COPY failure
from stopping the script while it waits for a response. For instance,
if a script calls for a certain file to be copied and the system cannot
find that file, normally the script would display a requester and would
wait until a response was given
. With the NOREQ option, the COPY
command would be aborted and the script would continue.
can someone confirm my findings?
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: Copy Command glitches

Post by thomasrapp »

Amigo1 wrote:I can't make COPY to open a requester, not from a Shell, nor from a script, regardless what I throw at it, so the NOREQ Option has no function here.

Try

Code: Select all

copy thomas: ram: all
then try

Code: Select all

copy thomas: ram: all noreq
The first one will open a "please insert volume thomas in any drive" requester, the second one won't.
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Re: Copy Command glitches

Post by Amigo1 »

thomasrapp wrote:
Amigo1 wrote:I can't make COPY to open a requester, not from a Shell, nor from a script, regardless what I throw at it, so the NOREQ Option has no function here.

Try

Code: Select all

copy thomas: ram: all
then try

Code: Select all

copy thomas: ram: all noreq
The first one will open a "please insert volume thomas in any drive" requester, the second one won't.

Right, that's it! As it seems I was too tired to think properly!! I tried all sort of combinations, but always with not existing files or copy protectected files or broken links, on existing volumes..
thanks.
What about the first glitch, did I overlook something or can you confirm it?
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 1:06 am

Re: Copy Command glitches

Post by xenic »

@amigo1
The problem with the Copy command and links has been discussed several times in other Amiga forums and possibly here in the Hyperion forums. Copy never reproduces links but will copy the files that file-links point to when the COPYLINKS argument is used. When plain "Copy ALL" is used the Copy command will at least warn you when file links are skipped. I never get any warnings when directory links are skipped; no matter what args are used.
My test indicate this:

Copy ALL - Warns when file links are skipped.
Copy ALL COPYLINKS - Copies files that file links point to.
Copy ALL FOLLOWLINKS - Warns when file links are skipped.
Directory links are never copied and there are never any warnings that they are skipped.

Even if you find some discrepancy in the above tests, it's obvious that data loss could occur if you copy directory links or directories containing subdirectory links. Any command that can cause user data loss is completely unacceptable and needs to be fixed immediately; even if the fix is only to warn the user that directory links are being skipped.

The Copy command documentation should certainly be updated to reflect the way the Copy command actually works. I too was missled by the FOLLOWLINKS argument documentation.

OS4 DOpus4 copies file links as the actual files but at least warns you when it encounters a directory link that won't be copied. The only method I know that will reprodece links in the destination is ASyncWB (Workbench drag n drop).
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Re: Copy Command glitches

Post by Amigo1 »

xenic wrote:@amigo1
... Any command that can cause user data loss is completely unacceptable and needs to be fixed immediately; even if the fix is only to warn the user that directory links are being skipped.

I can not disagree with you at all.
Post Reply