I have such string (it's a string that represents a system path actually):
./home/user/dir1/dir2/
And now, I would like to be able to create presented directory tree, so I need to create home, user, dir1, dir2.
I know how to create dirs in C in Linux, but have troubles with chopping off the string. Basically, what I need now is to have an array of strings:
tmp[0] = "./home/";
tmp[1] = "./home/user/";
tmp[2] = "./home/user/dir1/";
tmp[3] = "./home/user/dir1/dir2/";
and if I will hav such array it would be pretty easy to make presented dir tree but how to split the string in that way?
/as my path separatorstrtokstandard function.exec()mkdir -p ...and save yourself the headache./, copy string up until its position. Rinse, repeat.