Recursively Delete Folder And Files In C

In Corso Pubblicato 5 anni fa Pagato alla consegna
In Corso Pagato alla consegna

Can you recursively delete folder and files in C w/o using a call to system()? This is my current code, but I'd like to execute it w/o a call to system() if possible.

char* cmdPrefix = "rm -rf ";

char * cmd;

int len = (int)strlen("/localdir/");

cmd = malloc(len + 10);

memset(cmd, 0, len + 10);

sprintf(cmd, ("%s%s"), cmdPrefix, "//User//owner//Downloads//Test//");

system(cmd);

Programmazione C Programmazione C++ Architettura Software

Rif. progetto: #18763989

Info sul progetto

7 proposte Progetto a distanza Attivo 5 anni fa

Assegnato a:

TechMagnetos

Hi there, I’d like to be considered for your C Project. I’m a strategic developer and programmer with more than 5-year experience and a strong background in developing desktop software, Artificial Intelligence, Databa Altro

$15 USD in 1 giorno
(12 valutazioni)
3.6

7 freelance hanno fatto un'offerta media di $26 per questo lavoro

hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ Altro

$50 USD in 1 giorno
(175 valutazioni)
7.2
kaloyan13

Yes, I can. Basically, you traverse the folder and delete every file. Then remove the directory itself.

$30 USD in 1 giorno
(394 valutazioni)
7.2
gullzz

I assume you can use POSIX C here. Otherwise in windows RemoveDirectory winAPI. Somehow it’s possible to to what you have asked w/o using system().

$15 USD in 1 giorno
(1 Recensione)
1.5
benmarbihamza

hello sir I have good experience in c and c++ under both windows and Linux I can do this project using visual studio codeblocks dev ... when I complete your project you can check and then you can accept my b Altro

$20 USD in 1 giorno
(0 valutazioni)
0.0
namorg

Hello! Using system calls easy but not safe. It possible to do this without system calls. If you have any questions please contact me. Thanks!

$25 USD in 1 giorno
(0 valutazioni)
0.0