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

c# - Sort XmlNodeList with a specific Node value -

Android Java.Lang.RuntimeException : Unable to start activity Component Info -

actionscript 3 - Equivalent to moveReceived in ElectroServer 5 -