Lines Matching refs:file_path
42 char *file_path = NULL; in get_target_filepath() local
50 file_path = (char *)malloc(*result_path_len + 2); in get_target_filepath()
52 memset(file_path, 0, *result_path_len + 2); in get_target_filepath()
54 strncpy(file_path, shell_current_path, cwd_len); in get_target_filepath()
58 file_path[cwd_len] = '/'; in get_target_filepath()
61 strcat(file_path, filename); in get_target_filepath()
66 file_path = (char *)malloc(*result_path_len + 2); in get_target_filepath()
68 memset(file_path, 0, *result_path_len + 2); in get_target_filepath()
70 strncpy(file_path, filename, *result_path_len); in get_target_filepath()
72 file_path[*result_path_len] = '/'; in get_target_filepath()
75 return file_path; in get_target_filepath()
308 char *file_path = get_target_filepath(argv[1], &path_len); in shell_cmd_cat() local
311 int fd = open(file_path, 0); in shell_cmd_cat()
329 free(file_path); in shell_cmd_cat()
345 char *file_path; in shell_cmd_touch() local
348 file_path = argv[1]; in shell_cmd_touch()
351 file_path = get_target_filepath(argv[1], &path_len); in shell_cmd_touch()
356 int fd = open(file_path, O_CREAT); in shell_cmd_touch()
370 free(file_path); in shell_cmd_touch()
485 char *file_path = get_target_filepath(argv[1], &path_len); in shell_cmd_exec() local
487 execv(file_path, argv); in shell_cmd_exec()
489 free(file_path); in shell_cmd_exec()