method for creating char* from path simplyfied