Possible Duplicate:
How can I create directory tree in C++/Linux?
Why mkdir fails to work with tilde (~)?
i'm trying to create a directory in a C program and i use the mkdir function. My program is as follows:
#include <stdio.h>
#include <string.h>
#define MKDIR(x) mkdir(x)
int main() {
//If i do mkdir("foo"), the dir is created
mkdir("~/test/foo"); //Directory foo not created inside test dir
}
The dir foo isn't created in Test dir.
But how can i achieve that? Thanks, in advance