5 char* convert_path(char* origpath
)
10 newpath
= strdup(origpath
);
13 while (newpath
[i
] != 0)
16 if (newpath
[i
] == '\\')
22 if (newpath
[i
] == '/')
33 #define TRANSFER_SIZE (65536)
35 int mkdir_p(char* path
)
42 if (mkdir(path
, 0755) != 0)
44 perror("Failed to create directory");
50 perror("Failed to create directory");
57 perror("Failed to change directory");
63 int main(int argc
, char* argv
[])
73 fprintf(stderr
, "Too many arguments\n");
77 path1
= convert_path(argv
[1]);
79 if (isalpha(path1
[0]) && path1
[1] == ':' && path1
[2] == '/')
81 csec
= strtok(path1
, "/");
83 csec
= strtok(NULL
, "/");
85 else if (path1
[0] == '/')
88 csec
= strtok(path1
, "/");
92 csec
= strtok(path1
, "/");
98 csec
= strtok(NULL
, "/");