Mail Archives: djgpp/2007/09/29/14:45:13
MikeC escreveu:
> <Gordon DOT Schumacher AT seagate DOT com> wrote in message
> news:OF729DCA1D DOT 55951EA7-ON87257360 DOT 006A997C-87257360 DOT 006B1643 AT seagate DOT com...
>> "MikeC" <My_address AT end DOT of DOT post> wrote on Fri, 21 Sep 2007 00:31:07 GMT:
>>
>> # Why can't I do it with ...
>> #
>> # system(string); /* string contains "copy <source path> <dest path>" */
>> #
>> # ... as I tried? It compiles OK, and appears to execute when I
>> single-step
>> # the program under RHIDE, but it takes an instant - not a minute or
>> more -
>>
>> # and the file doesn't get copied. I don't know what I'm doing wrong.
>>
>> You can. As mentioned, there's no "copy" program - it's trying to
>> find "copy.exe" or "copy.com".
>>
>> That means there's two answers:
>> 1) Use XCOPY.EXE
>> 2) Invoke the command interpreter:
>> system("command.com /c copy ....");
>>
>> The second can be a little tricky, because you have to know the name of
>> the command interpreter. Go with COMMAND.COM, even though that's not
>> what is usually used for a DOS box in 2K/XP.
>>
>
> Thanks a million, Gordon,
>
> How did you know that xcopy is an embedded command, and that copy is not?
> Where do I find this kind of information?
>
The canonical answer for this is: look at good MS-DOS manual. The 'copy'
command is called 'internal' and 'xcopy' is called 'external'.
Regards,
--
Cesar Rabak
- Raw text -