| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| X-Recipient: | djgpp AT delorie DOT com |
| In-Reply-To: | <200709210405.l8L451Dt021713@delorie.com> |
| Subject: | Re: How to copy a file? |
| To: | djgpp AT delorie DOT com |
| X-Mailer: | Lotus Notes Release 7.0.2 September 26, 2006 |
| Message-ID: | <OF729DCA1D.55951EA7-ON87257360.006A997C-87257360.006B1643@seagate.com> |
| From: | Gordon DOT Schumacher AT seagate DOT com |
| Date: | Mon, 24 Sep 2007 13:29:45 -0600 |
| X-MIMETrack: | Serialize by Router on SV-GW1/Seagate Internet(Release 7.0.1 HF29|March 07, 2006) at |
| 09/24/2007 12:29:55 PM | |
| MIME-Version: | 1.0 |
| X-Proofpoint-FWRule: | outbound2 |
| X-Proofpoint-Virus-Version: | vendor=fsecure engine=4.65.5502:2.3.11,1.2.37,4.0.164 definitions=2007-09-24_05:2007-09-23,2007-09-24,2007-09-24 signatures=0 |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie 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.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |