Click here to Skip to main content
15,905,233 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am usnig C on AIX.
I want to create a directory in some path.
Before creating it, i want to check if it already exist or not.
How can I do these things in C? Please help me out.

Thanks in advance.
Posted

I think you should be able to use the _mkdir and _access functions.

Max.
 
Share this answer
 
Hi,

Thanks for reply I am using plain C code on AIX.
I had included sys/types.h and sys/stat.h

sprintf(DocDir,"%s/%s",<PATH OF DIR>,"DIRNAME");
mkdir(DocDir,0777);

But receiving error as,
the text "mkdir" is unexpected.

Please help me out.
 
Share this answer
 
Hello I send some code for create new directory
just you add button and set it's click event this code
if (System.IO.Directory.CreateDirectory("C:/Hello").Exists)
    {
         MessageBox.Show("AllReady Available");
    }
    else
    {
         System.IO.Directory.CreateDirectory("C:/Hello");
         MessageBox.Show("Create Directory");
    }


Hope For Help
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900