Making a folder

I have ran into a problem with regarding I/O
The problem is that the user specifies a relative directory path, and i have to create a folder, then save all the files in that directory.

I am clueless on how you can make a directory with relative path .

any help please
Well, CreateDirectory("../new_directory", 0); seems to work fine.
1
2
3
4
#include <sys/stat.h>
#include <sys/types.h>

int mkdir(const char *pathname, mode_t mode);
Where mode is a bitor of the directory permissions.

1
2
3
4
5
#define _ATFILE_SOURCE
#include <fcntl.h> /* Definition of AT_* constants */
#include <sys/stat.h>

int mkdirat(int dirfd, const char *pathname, mode_t mode);
relative to dirfd (file descriptor)
Last edited on
hamsterman, which library is it in, and i am on Redhat and Unbuntu
Sorry, I somehow assumed windows.
Topic archived. No new replies allowed.