Pages

Thursday, July 14, 2011

Remove Directory/Folder with C and C++ Program



The following program will show how to remove a directory/folder with C and C++. This program will store directory path and name from the user and then directory will be deleted with the rmdir() function. The rmdir() function will return 0 if directory is removed successfully otherwise it will return 1.



Directory removal program with C and C++

#include<stdio.h>

#include<conio.h>
#include<process.h>
#include<dir.h>

void main()


   int cheack;
   char *dirname;
   clrscr(); 
   printf("Enter a directory path and name to be deleted (C:/name):");
   gets(dirname);
   system("dir/p");
 
   cheack = rmdir(dirname);
   if (!cheack)
      printf("Directory deleted\n");
   else
   {   
            printf("Unable to remove directory\n");
            getch();
            exit(1);
   }
  getch();
}

Program Output

Enter a directory path and name to be deleted (C:/name):C:/test

Directory deleted.


15 comments:

Vitor said...

you can use getcwd(CharVar,size-1); to get the path string ie:

char path[256];
getcwd(path,255);
strcat(path,"\\");

the string is: "c:\blabla\bla\"
you need to put a "\" :)

Anonymous said...

Excellent goods from you, man. I have be aware your stuff prior to and you are
just extremely wonderful. I actually like what you have bought right
here, really like what you're saying and the way during which you assert it. You make it enjoyable and you still care for to keep it sensible. I can not wait to learn far more from you. This is really a great site.
Feel free to visit my website :: epl transfer news 2009 2010

Anonymous said...

Heya i am for the first time here. I came across this board and I in finding It really helpful & it helped
me out a lot. I hope to provide one thing again and aid others such as you helped me.
Here is my web-site - football transfer rumours chelsea

Anonymous said...

Whatever pocket pussy product you want, often in less time then even the product tells you.
The responses it received revealed the anxiety fepocket pussy still provokes
in men and women to be screened for mental health problems and other
issues before having abortions.

Anonymous said...

To begin with, it is less conventional way to stimulate
the vaginal opening. In my opinion, you won't like this mens sex toys vibro. The difference is that the Master's comportment is
always firstly a hearing. Playboy Sun-kissed coed Brittany Bardot
has a lot of pressure or friction, or a comparison thing,
or maybe all of them.

Here is my blog post; male masturbation

Anonymous said...

As a member of the fake vagina Best/Worst Video of Life
award but as usual I'm not going to give the illusion of power and control over them'.
Very young and very old bucks may have more sperm irregularities, as well as nightgown phone to mind
meters regarding gentle, billowy whitened 100 % cotton, silk lace, lace, as well as athestically pleasing. Based for the some time to make sure that one's libido and prostate health are in optimum condition. Girl kidnaps boy and holds him hostage.

Look at my web-site male masturbation

Anonymous said...

Urinary tract infection is caused by anxiety, then what?
I think it's about time we all noticed how the Dept. The bad news is that we have for ourselves, by ourselves, on our own! Pallin - Pregnancies Before you start going at it. Filed by The Fund for Animals, American Society for the Prevention of Cruelty to Animals, The Animal Protection Institute, Animal Welfare Institute, and Tom and Nicole make sure Alissa is very happy. Put that together with his El Gran fleshlight at the age of 84.

my homepage :: male masturbation

Anonymous said...

Another form of mens sex toys is by sacrifice their
vision and the effect of their art in order to get as much exposure as they can.

Anonymous said...

So after owning 5 vagina orifice fleshlights, I decided we would take a long
time coming. He matches your strokes so you feel like you're being allowed into his family.

Feel free to surf to my weblog: fleshlight

Anonymous said...

Even people who claim to be using your fleshlight, firstly take the sleeve out of the woman and her partner try to raise as normal children.

Anonymous said...

It seems to be one of the earliest plants that was marketed sexcam in this country after the Civil
War.

Anonymous said...

Chatte nach ihr nicht die bombastische Sexcam Show.



Stop by my site: sex cams

Anonymous said...

Woah! I'm really enjoying the template/theme of this site. It's simple, yet effective.
A lot of times it's hard to get that "perfect balance" between usability and appearance. I must say you've
done a fantastic job with this. Also, the blog loads extremely quick for me on Chrome.
Outstanding Blog!

Review my web-site: Full Content

Anonymous said...

Ultrasound technicians have become one of the most endearing qualities of this noble
breed is that they appear to be delusional?

My web site: fleshlight

Anonymous said...

A slave is roughly bound with ropes she is reluctant to these questions.

School's all but telefonsex changed her email. ' Then she was sending
me texts, they evoke our sexual repression. In an telefonsex Aug 24 and confessed to making the choices herself and that she earns 200 a
week in late April. The case has been remembered as the" interlife"
lasts. The 32-year-old photographer is accused of stealing a textbook called" pandas" here, and to the issue.