delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/09/29/14:45:13

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Cesar Rabak <csrabak AT yahoo DOT com DOT br>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to copy a file?
Date: Sat, 29 Sep 2007 15:43:02 -0300
Organization: Aioe.org NNTP Server
Lines: 41
Message-ID: <fdm663$ud8$1@aioe.org>
References: <OF729DCA1D DOT 55951EA7-ON87257360 DOT 006A997C-87257360 DOT 006B1643 AT seagate DOT com> <fEuLi.16417$HW DOT 10333 AT newsfe3-gui DOT ntli DOT net>
NNTP-Posting-Host: qQd7UG1/ctPhtnMYAzFwDg.user.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse AT aioe DOT org
In-Reply-To:
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019