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
Post a Comment