| www.delorie.com/archives/browse.cgi | search |
| From: | "-hs-" <email DOT invalid AT server DOT invalid> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Copying a file |
| Date: | Sat, 8 Apr 2000 20:39:50 +0200 |
| Lines: | 39 |
| Message-ID: | <8cnudn$iia$1@news3.isdnet.net> |
| References: | <38e68b0b DOT 1715577 AT news DOT freeserve DOT net> |
| NNTP-Posting-Host: | e235.paris-94.cybercable.fr |
| Mime-Version: | 1.0 |
| X-Trace: | news3.isdnet.net 955219191 19018 212.198.94.235 (8 Apr 2000 18:39:51 GMT) |
| X-Complaints-To: | abuse AT isdnet DOT net |
| NNTP-Posting-Date: | 8 Apr 2000 18:39:51 GMT |
| X-Newsreader: | Microsoft Outlook Express 4.72.3110.5 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Paulio a écrit dans le message <38e68b0b DOT 1715577 AT news DOT freeserve DOT net>...
>Sorry if this is a little simple, but how do you copy a file in djgpp?
>Ive looked under file system functions but I cant seem to find
>anything.
#include <stdio.h>
#include <stdlib.h>
#if defined(__DJGPP__)
# define COPY_CMD "copy"
#endif
copy_files(char const *const src, char const *const des)
{
if (src && des && strlen(src) && strlen(des))
{
size_t len=strlen(src)+strlen(des)+10;
char *const s=malloc(len);
if(s)
{
sprintf(s,COPY_CMD" %s %s",src,des);
system(s);
free(s);
}
}
}
*** NOT TESTED ***
--
-hs- "Stove"
CLC-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
ISO-C Library: http://www.dinkum.com/htm_cl
"Really? When run on my machine, a printed copy of the C FAQ leaps
from the monitor and whacks me over the head.." -- Chris Mears CLC
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |