linux - mkdir system call with variable (C) -


i'm new linux system programming. task is: create system variable "my_dir" valuable "lab01" , create file inside it.

i've created folder, can't create file using varialble

putenv("my_dir=lab01"); mkdir_ret_code = mkdir(("/home/alexander/%s",getenv("my_dir")),0777); 

how solve problem?

use array , use these functions http://linux.die.net/man/3/string


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -