Lines Matching refs:file_path

53     char *file_path = NULL;  in get_target_filepath()  local
61 file_path = (char *)malloc(*result_path_len + 2); in get_target_filepath()
63 memset(file_path, 0, *result_path_len + 2); in get_target_filepath()
65 strncpy(file_path, shell_current_path, cwd_len); in get_target_filepath()
69 file_path[cwd_len] = '/'; in get_target_filepath()
72 strcat(file_path, filename); in get_target_filepath()
77 file_path = (char *)malloc(*result_path_len + 2); in get_target_filepath()
79 memset(file_path, 0, *result_path_len + 2); in get_target_filepath()
81 strncpy(file_path, filename, *result_path_len); in get_target_filepath()
83 file_path[*result_path_len] = '/'; in get_target_filepath()
86 return file_path; in get_target_filepath()
319 char *file_path = get_target_filepath(argv[1], &path_len); in shell_cmd_cat() local
322 int fd = open(file_path, 0); in shell_cmd_cat()
325 printf("ERROR: Cannot open file: %s, fd=%d\n", file_path, fd); in shell_cmd_cat()
341 printf("ERROR: Cannot read file: %s\n", file_path); in shell_cmd_cat()
351 free(file_path); in shell_cmd_cat()
367 char *file_path; in shell_cmd_touch() local
370 file_path = argv[1]; in shell_cmd_touch()
373 file_path = get_target_filepath(argv[1], &path_len); in shell_cmd_touch()
378 int fd = open(file_path, O_CREAT); in shell_cmd_touch()
392 free(file_path); in shell_cmd_touch()
507 char *file_path = get_target_filepath(argv[1], &path_len); in shell_cmd_exec() local
509 execv(file_path, argv); in shell_cmd_exec()
512 free(file_path); in shell_cmd_exec()