Quote:
Originally Posted by Foebane
Sounds complicated.
|
Actually it is not complicated at all. If you enter
copy ? it will display the command line template. This template is used to read the command line arguments. This is done by the ReadArgs function independently of the purpose of the command. This means at this stage it does not yet look into the file system and this it does not matter whether a file named ALL is there or not.
The template contains four parameters: FROM, TO, ALL and CLONE. The ReadArgs function parses the command line and fills in these four parameters. If the word ALL is found, the ALL switch will be set on. If the word CLONE is found, the CLONE switch will be set on. If the word FROM is found, the string behind it will be put into the FROM parameter. If the word TO is found, the string behind it will be put into the TO parameter. If neither FROM or TO are found but there are unnamed arguments, the first one will be put into FROM and the last one into TO.
When the ReadArgs function returns, the Copy command will continue with the parameter list returned. It does not look into the command line any more. It uses the switches and strings returned by the ReadArgs function in the parameter list.
So in order to copy the ALL file, you have to think how to tell ReadArgs that the string ALL should go into the FROM place of the parameter list.
should do it. The "all" string will go into the FROM place because it is preceded by the "from" keyword. "dh0:" will go into the TO place because it is unnamed and FROM is already set.