您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vfs_path_from_str函数代码示例

51自学网 2021-06-03 09:38:49
  C++
这篇教程C++ vfs_path_from_str函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vfs_path_from_str函数的典型用法代码示例。如果您正苦于以下问题:C++ vfs_path_from_str函数的具体用法?C++ vfs_path_from_str怎么用?C++ vfs_path_from_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vfs_path_from_str函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: apply_advanced_chowns

static voidapply_advanced_chowns (struct stat *sf){    vfs_path_t *vpath;    char *lc_fname;    gid_t a_gid = sf->st_gid;    uid_t a_uid = sf->st_uid;    lc_fname = current_panel->dir.list[current_file].fname;    vpath = vfs_path_from_str (lc_fname);    need_update = end_chown = TRUE;    if (mc_chmod (vpath, get_mode ()) == -1)        message (D_ERROR, MSG_ERROR, _("Cannot chmod /"%s/"/n%s"),                 lc_fname, unix_error_string (errno));    /* call mc_chown only, if mc_chmod didn't fail */    else if (mc_chown (vpath, (ch_flags[9] == '+') ? sf->st_uid : (uid_t) (-1),                       (ch_flags[10] == '+') ? sf->st_gid : (gid_t) (-1)) == -1)        message (D_ERROR, MSG_ERROR, _("Cannot chown /"%s/"/n%s"),                 lc_fname, unix_error_string (errno));    do_file_mark (current_panel, current_file, 0);    vfs_path_free (vpath);    do    {        lc_fname = next_file ();        vpath = vfs_path_from_str (lc_fname);        if (mc_stat (vpath, sf) != 0)        {            vfs_path_free (vpath);            break;        }        ch_cmode = sf->st_mode;        if (mc_chmod (vpath, get_mode ()) == -1)            message (D_ERROR, MSG_ERROR, _("Cannot chmod /"%s/"/n%s"),                     lc_fname, unix_error_string (errno));        /* call mc_chown only, if mc_chmod didn't fail */        else if (mc_chown (vpath, (ch_flags[9] == '+') ? a_uid : (uid_t) (-1),                           (ch_flags[10] == '+') ? a_gid : (gid_t) (-1)) == -1)            message (D_ERROR, MSG_ERROR, _("Cannot chown /"%s/"/n%s"),                     lc_fname, unix_error_string (errno));        do_file_mark (current_panel, current_file, 0);        vfs_path_free (vpath);    }    while (current_panel->marked != 0);}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:49,


示例2: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (check_if_filename_and_lineno_will_be_subtituted, check_subtitute_ds)/* *INDENT-ON* */{    /* given */    char *actual_result;    vfs_path_t *filename_vpath;    g_ptr_array_add (mc_config_get_string__return_value, g_strdup (data->config_opts_string));    filename_vpath = vfs_path_from_str (data->file_name);    /* when */    actual_result =        execute_get_external_cmd_opts_from_config (data->app_name, filename_vpath,                                                   data->start_line);    /* then */    /* check returned value */    mctest_assert_str_eq (actual_result, data->expected_result);    /* check calls to mc_config_get_string() function */    mctest_assert_str_eq (g_ptr_array_index (mc_config_get_string__group__captured, 0),                          CONFIG_EXT_EDITOR_VIEWER_SECTION);    mctest_assert_str_eq (g_ptr_array_index (mc_config_get_string__param__captured, 0),                          data->app_name);    mctest_assert_str_eq (g_ptr_array_index (mc_config_get_string__default_value__captured, 0),                          NULL);    vfs_path_free (filename_vpath);}
开发者ID:ActionLuzifer,项目名称:mc,代码行数:32,


示例3: edit_symlink_cmd

voidedit_symlink_cmd (void){    if (S_ISLNK (selection (current_panel)->st.st_mode))    {        char buffer[MC_MAXPATHLEN];        char *p = NULL;        int i;        char *q;        vfs_path_t *p_vpath;        p = selection (current_panel)->fname;        p_vpath = vfs_path_from_str (p);        q = g_strdup_printf (_("Symlink '%s/' points to:"), str_trunc (p, 32));        i = readlink (p, buffer, MC_MAXPATHLEN - 1);        if (i > 0)        {            char *dest;            buffer[i] = 0;            dest =                input_expand_dialog (_("Edit symlink"), q, MC_HISTORY_FM_EDIT_LINK, buffer,                                     INPUT_COMPLETE_FILENAMES);            if (dest)            {                if (*dest && strcmp (buffer, dest))                {                    save_cwds_stat ();                    if (mc_unlink (p_vpath) == -1)                    {                        message (D_ERROR, MSG_ERROR, _("edit symlink, unable to remove %s: %s"),                                 p, unix_error_string (errno));                    }                    else                    {                        vfs_path_t *dest_vpath;                        dest_vpath = vfs_path_from_str_flags (dest, VPF_NO_CANON);                        if (mc_symlink (dest_vpath, p_vpath) == -1)                            message (D_ERROR, MSG_ERROR, _("edit symlink: %s"),                                     unix_error_string (errno));                        vfs_path_free (dest_vpath);                    }                    update_panels (UP_OPTIMIZE, UP_KEEPSEL);                    repaint_screen ();                }                g_free (dest);            }        }        g_free (q);        vfs_path_free (p_vpath);    }    else    {        message (D_ERROR, MSG_ERROR, _("'%s' is not a symbolic link"),                 selection (current_panel)->fname);    }}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:60,


示例4: START_TEST

END_TEST/* --------------------------------------------------------------------------------------------- */START_TEST (test_vfs_path_from_to_string2){    vfs_path_t *vpath;    size_t vpath_len;    char *result;    const vfs_path_element_t *path_element;    vpath = vfs_path_from_str ("/");    vpath_len = vfs_path_elements_count(vpath);    fail_unless(vpath_len == 1, "vpath length should be 1 (actial: %d)",vpath_len);    result = vfs_path_to_str(vpath);    fail_unless(strcmp("/", result) == 0, "expected(%s) doesn't equal to actual(%s)", "/", result);    g_free(result);    path_element = vfs_path_get_by_index (vpath, -1);    fail_unless(strcmp("/", path_element->path) == 0, "expected(%s) doesn't equal to actual(%s)", "/", path_element->path);    fail_unless(path_element->class == &vfs_local_ops , "actual vfs-class doesn't equal to localfs");    vfs_path_free(vpath);}
开发者ID:ryanlee,项目名称:mc,代码行数:26,


示例5: START_TEST

END_TEST/* --------------------------------------------------------------------------------------------- */START_TEST(test_encode_info_at_start){    vfs_path_t *vpath;    char *actual;    const vfs_path_element_t *vpath_element;    test_init_vfs("UTF-8");    vpath = vfs_path_from_str ("#enc:KOI8-R/bla-bla/some/path");    actual = vfs_path_to_str (vpath);    fail_unless (strcmp ("/#enc:KOI8-R/bla-bla/some/path", actual) == 0, "/nactual=%s/n", actual);    vpath_element = vfs_path_get_by_index (vpath, -1);    fail_unless (strcmp ("/bla-bla/some/path", vpath_element->path) == 0, "/nvpath_element->path=%s/n", vpath_element->path);    g_free (actual);    vfs_path_free (vpath);    test_deinit_vfs();}
开发者ID:Chainie,项目名称:mc,代码行数:26,


示例6: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (the_file_is_local, the_file_is_local_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *filename_vpath;    filename_vpath = vfs_path_from_str (data->input_path);    vfs_file_is_local__return_value = TRUE;    /* when */    execute_with_vfs_arg ("cmd_for_local_file", filename_vpath);    /* then */    mctest_assert_str_eq (do_execute__lc_shell__captured, "cmd_for_local_file");    mctest_assert_str_eq (do_execute__command__captured, data->input_path);    mctest_assert_int_eq (vfs_file_is_local__vpath__captured->len, 1);    {        const vfs_path_t *tmp_vpath;        tmp_vpath = (data->input_path == NULL) ? vfs_get_raw_current_dir () : filename_vpath;        mctest_assert_int_eq (vfs_path_equal                              (g_ptr_array_index (vfs_file_is_local__vpath__captured, 0),                               tmp_vpath), TRUE);    }    mctest_assert_int_eq (do_execute__flags__captured, EXECUTE_INTERNAL);    fail_unless (mc_getlocalcopy__pathname_vpath__captured == NULL,                 "/nFunction mc_getlocalcopy() shouldn't be called!");    vfs_path_free (filename_vpath);}
开发者ID:MidnightCommander,项目名称:mc,代码行数:32,


示例7: apply_mask

static voidapply_mask (struct stat *sf){    need_update = TRUE;    end_chmod = TRUE;    do_chmod (sf);    do    {        char *fname;        vfs_path_t *vpath;        gboolean ok;        fname = next_file ();        vpath = vfs_path_from_str (fname);        ok = (mc_stat (vpath, sf) == 0);        vfs_path_free (vpath);        if (!ok)            return;        c_stat = sf->st_mode;        do_chmod (sf);    }    while (current_panel->marked != 0);}
开发者ID:BrEacK,项目名称:mc,代码行数:27,


示例8: edit_cmd_new

voidedit_cmd_new (void){    vfs_path_t *fname_vpath = NULL;    if (editor_ask_filename_before_edit)    {        char *fname;        fname = input_expand_dialog (_("Edit file"), _("Enter file name:"),                                     MC_HISTORY_EDIT_LOAD, "", INPUT_COMPLETE_FILENAMES);        if (fname == NULL)            return;        if (*fname != '/0')            fname_vpath = vfs_path_from_str (fname);        g_free (fname);    }#ifdef HAVE_CHARSET    mc_global.source_codepage = default_source_codepage;#endif    do_edit (fname_vpath);    vfs_path_free (fname_vpath);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:27,


示例9: invoke_subshell

intinvoke_subshell (const char *command, int how, vfs_path_t ** new_dir_vpath){    char *pcwd;    /* Make the MC terminal transparent */    tcsetattr (STDOUT_FILENO, TCSANOW, &raw_mode);    /* Make the subshell change to MC's working directory */    if (new_dir_vpath != NULL)        do_subshell_chdir (current_panel->cwd_vpath, TRUE, TRUE);    if (command == NULL)        /* The user has done "C-o" from MC */    {        if (subshell_state == INACTIVE)        {            subshell_state = ACTIVE;            /* FIXME: possibly take out this hack; the user can               re-play it by hitting C-hyphen a few times! */            if (subshell_ready)                write_all (mc_global.tty.subshell_pty, " /b", 2);       /* Hack to make prompt reappear */        }    }    else                        /* MC has passed us a user command */    {        if (how == QUIETLY)            write_all (mc_global.tty.subshell_pty, " ", 1);        /* FIXME: if command is long (>8KB ?) we go comma */        write_all (mc_global.tty.subshell_pty, command, strlen (command));        write_all (mc_global.tty.subshell_pty, "/n", 1);        subshell_state = RUNNING_COMMAND;        subshell_ready = FALSE;    }    feed_subshell (how, FALSE);    {        char *cwd_str;        cwd_str = vfs_path_to_str (current_panel->cwd_vpath);        pcwd = vfs_translate_path_n (cwd_str);        g_free (cwd_str);    }    if (new_dir_vpath != NULL && subshell_alive && strcmp (subshell_cwd, pcwd))        *new_dir_vpath = vfs_path_from_str (subshell_cwd);      /* Make MC change to the subshell's CWD */    g_free (pcwd);    /* Restart the subshell if it has died by SIGHUP, SIGQUIT, etc. */    while (!subshell_alive && quit == 0 && mc_global.tty.use_subshell)        init_subshell ();    prompt_pos = 0;    return quit;}
开发者ID:bobisjan,项目名称:mc,代码行数:56,


示例10: edit_cmd

voidedit_cmd (void){    vfs_path_t *fname;    fname = vfs_path_from_str (selection (current_panel)->fname);    if (regex_command (fname, "Edit") == 0)        do_edit (fname);    vfs_path_free (fname);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:10,


示例11: edit_cmd_force_internal

voidedit_cmd_force_internal (void){    vfs_path_t *fname;    fname = vfs_path_from_str (selection (current_panel)->fname);    if (regex_command (fname, "Edit") == 0)        edit_file_at_line (fname, TRUE, 1);    vfs_path_free (fname);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:10,


示例12: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_path_equal_len, test_path_equal_len_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath1, *vpath2;    gboolean actual_result;    vpath1 = vfs_path_from_str (data->input_path1);    vpath2 = vfs_path_from_str (data->input_path2);    /* when */    actual_result = vfs_path_equal_len (vpath1, vpath2, data->input_length);    /* then */    mctest_assert_int_eq (actual_result, data->expected_result);    vfs_path_free (vpath1);    vfs_path_free (vpath2);}
开发者ID:idispatch,项目名称:mc,代码行数:20,


示例13: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_vfs_path_append_vpath, test_vfs_path_append_vpath_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath1, *vpath2, *vpath3;    vpath1 = vfs_path_from_str (data->input_path1);    vpath2 = vfs_path_from_str (data->input_path2);    /* when */    vpath3 = vfs_path_append_vpath_new (vpath1, vpath2, NULL);    /* then */    mctest_assert_int_eq (vfs_path_elements_count (vpath3), data->expected_element_count);    mctest_assert_str_eq (vfs_path_as_str (vpath3), data->expected_path);    vfs_path_free (vpath1);    vfs_path_free (vpath2);    vfs_path_free (vpath3);}
开发者ID:Acidburn0zzz,项目名称:mc,代码行数:21,


示例14: sftpfs_correct_file_name

static char *sftpfs_correct_file_name (const char *filename){    vfs_path_t *vpath;    char *ret_value;    vpath = vfs_path_from_str (filename);    ret_value = vfs_path_to_str (vpath);    vfs_path_free (vpath);    return ret_value;}
开发者ID:Chainie,项目名称:mc,代码行数:11,


示例15: edit_mc_menu_cmd

voidedit_mc_menu_cmd (void){    vfs_path_t *buffer_vpath;    vfs_path_t *menufile_vpath;    int dir = 0;    query_set_sel (1);    dir = query_dialog (_("Menu edit"),                        _("Which menu file do you want to edit?"),                        D_NORMAL, geteuid ()? 2 : 3, _("&Local"), _("&User"), _("&System Wide"));    menufile_vpath = vfs_path_build_filename (mc_global.sysconfig_dir, MC_GLOBAL_MENU, NULL);    if (!exist_file (vfs_path_get_last_path_str (menufile_vpath)))    {        vfs_path_free (menufile_vpath);        menufile_vpath = vfs_path_build_filename (mc_global.share_data_dir, MC_GLOBAL_MENU, NULL);    }    switch (dir)    {    case 0:        buffer_vpath = vfs_path_from_str (MC_LOCAL_MENU);        check_for_default (menufile_vpath, buffer_vpath);        chmod (vfs_path_get_last_path_str (buffer_vpath), 0600);        break;    case 1:        buffer_vpath = mc_config_get_full_vpath (MC_USERMENU_FILE);        check_for_default (menufile_vpath, buffer_vpath);        break;    case 2:        buffer_vpath = vfs_path_build_filename (mc_global.sysconfig_dir, MC_GLOBAL_MENU, NULL);        if (!exist_file (vfs_path_get_last_path_str (buffer_vpath)))        {            vfs_path_free (buffer_vpath);            buffer_vpath = vfs_path_build_filename (mc_global.share_data_dir, MC_GLOBAL_MENU, NULL);        }        break;    default:        vfs_path_free (menufile_vpath);        return;    }    do_edit (buffer_vpath);    vfs_path_free (buffer_vpath);    vfs_path_free (menufile_vpath);}
开发者ID:BpArCuCTeMbI,项目名称:mc,代码行数:52,


示例16: sftpfs_correct_file_name

static char *sftpfs_correct_file_name (const char *filename){    vfs_path_t *vpath;    char *ret_value;    ret_value = tilde_expand (filename);    vpath = vfs_path_from_str (ret_value);    g_free (ret_value);    ret_value = g_strdup (vfs_path_as_str (vpath));    vfs_path_free (vpath);    return ret_value;}
开发者ID:ActionLuzifer,项目名称:mc,代码行数:13,


示例17: do_chown

static voiddo_chown (uid_t u, gid_t g){    vfs_path_t *vpath;    vpath = vfs_path_from_str (current_panel->dir.list[current_file].fname);    if (mc_chown (vpath, u, g) == -1)        message (D_ERROR, MSG_ERROR, _("Cannot chown /"%s/"/n%s"),                 current_panel->dir.list[current_file].fname, unix_error_string (errno));    vfs_path_free (vpath);    do_file_mark (current_panel, current_file, 0);}
开发者ID:LubkaB,项目名称:mc,代码行数:13,


示例18: handle_dirent

static inthandle_dirent (dir_list * list, const char *fltr, struct dirent *dp,               struct stat *buf1, int next_free, int *link_to_dir, int *stale_link){    vfs_path_t *vpath;    if (dp->d_name[0] == '.' && dp->d_name[1] == 0)        return 0;    if (dp->d_name[0] == '.' && dp->d_name[1] == '.' && dp->d_name[2] == 0)        return 0;    if (!panels_options.show_dot_files && (dp->d_name[0] == '.'))        return 0;    if (!panels_options.show_backups && dp->d_name[NLENGTH (dp) - 1] == '~')        return 0;    vpath = vfs_path_from_str (dp->d_name);    if (mc_lstat (vpath, buf1) == -1)    {        /*         * lstat() fails - such entries should be identified by         * buf1->st_mode being 0.         * It happens on QNX Neutrino for /fs/cd0 if no CD is inserted.         */        memset (buf1, 0, sizeof (*buf1));    }    if (S_ISDIR (buf1->st_mode))        tree_store_mark_checked (dp->d_name);    /* A link to a file or a directory? */    *link_to_dir = 0;    *stale_link = 0;    if (S_ISLNK (buf1->st_mode))    {        struct stat buf2;        if (mc_stat (vpath, &buf2) == 0)            *link_to_dir = S_ISDIR (buf2.st_mode) != 0;        else            *stale_link = 1;    }    vfs_path_free (vpath);    if (!(S_ISDIR (buf1->st_mode) || *link_to_dir) && (fltr != NULL)        && !mc_search (fltr, dp->d_name, MC_SEARCH_T_GLOB))        return 0;    /* Need to grow the *list? */    if (next_free == list->size && !grow_list (list))        return -1;    return 1;}
开发者ID:Chainie,项目名称:mc,代码行数:51,


示例19: mc_config_new_or_override_file

static gbooleanmc_config_new_or_override_file (mc_config_t * mc_config, const gchar * ini_path, GError ** mcerror){    gchar *data, *written_data;    gsize len, total_written;    gboolean ret;    int fd;    ssize_t cur_written;    vfs_path_t *ini_vpath;    mc_return_val_if_error (mcerror, FALSE);    data = g_key_file_to_data (mc_config->handle, &len, NULL);    if (!exist_file (ini_path))    {        ret = g_file_set_contents (ini_path, data, len, mcerror);        g_free (data);        return ret;    }    mc_util_make_backup_if_possible (ini_path, "~");    ini_vpath = vfs_path_from_str (ini_path);    fd = mc_open (ini_vpath, O_WRONLY | O_TRUNC, 0);    vfs_path_free (ini_vpath);    if (fd == -1)    {        mc_propagate_error (mcerror, 0, "%s", unix_error_string (errno));        g_free (data);        return FALSE;    }    for (written_data = data, total_written = len;         (cur_written = mc_write (fd, (const void *) written_data, total_written)) > 0;         written_data += cur_written, total_written -= cur_written)        ;    mc_close (fd);    g_free (data);    if (cur_written == -1)    {        mc_util_restore_from_backup_if_possible (ini_path, "~");        mc_propagate_error (mcerror, 0, "%s", unix_error_string (errno));        return FALSE;    }    mc_util_unlink_backup_if_possible (ini_path, "~");    return TRUE;}
开发者ID:ginggs,项目名称:maemo-mc,代码行数:50,


示例20: tree_chdir

voidtree_chdir (WTree * tree, const char *dir){    vfs_path_t *vpath;    tree_entry *current;    vpath = vfs_path_from_str (dir);    current = tree_store_whereis (vpath);    if (current != NULL)    {        tree->selected_ptr = current;        tree_check_focus (tree);    }    vfs_path_free (vpath);}
开发者ID:GalaxyTab4,项目名称:workbench,代码行数:15,


示例21: do_chmod

static voiddo_chmod (struct stat *sf){    vfs_path_t *vpath;    sf->st_mode &= and_mask;    sf->st_mode |= or_mask;    vpath = vfs_path_from_str (current_panel->dir.list[c_file].fname);    if (mc_chmod (vpath, sf->st_mode) == -1)        message (D_ERROR, MSG_ERROR, _("Cannot chmod /"%s/"/n%s"),                 current_panel->dir.list[c_file].fname, unix_error_string (errno));    vfs_path_free (vpath);    do_file_mark (current_panel, c_file, 0);}
开发者ID:BrEacK,项目名称:mc,代码行数:15,


示例22: mkdir_cmd

voidmkdir_cmd (void){    char *dir;    const char *name = "";    /* If 'on' then automatically fills name with current selected item name */    if (auto_fill_mkdir_name && !DIR_IS_DOTDOT (selection (current_panel)->fname))        name = selection (current_panel)->fname;    dir =        input_expand_dialog (_("Create a new Directory"),                             _("Enter directory name:"), MC_HISTORY_FM_MKDIR, name,                             INPUT_COMPLETE_FILENAMES);    if (dir != NULL && *dir != '/0')    {        vfs_path_t *absdir;        if (dir[0] == '/' || dir[0] == '~')            absdir = vfs_path_from_str (dir);        else        {            /* possible escaped '~' */            /* allow create directory with name '~' */            char *tmpdir = dir;            if (dir[0] == '//' && dir[1] == '~')                tmpdir = dir + 1;            absdir = vfs_path_append_new (current_panel->cwd_vpath, tmpdir, NULL);        }        save_cwds_stat ();        if (my_mkdir (absdir, 0777) == 0)        {            update_panels (UP_OPTIMIZE, dir);            repaint_screen ();            select_item (current_panel);        }        else        {            message (D_ERROR, MSG_ERROR, "%s", unix_error_string (errno));        }        vfs_path_free (absdir);    }    g_free (dir);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:48,


示例23: setup

static voidsetup (void){    str_init_strings (NULL);    vfs_init ();    init_localfs ();    vfs_setup_work_dir ();    mc_global.mc_run_mode = MC_RUN_FULL;    current_panel = g_new0 (WPanel, 1);    current_panel->cwd_vpath = vfs_path_from_str ("/home");    current_panel->dir.size = DIR_LIST_MIN_SIZE;    current_panel->dir.list = g_new0 (file_entry_t, current_panel->dir.size);    current_panel->dir.len = 0;}
开发者ID:MidnightCommander,项目名称:mc,代码行数:16,


示例24: vfs_list

voidvfs_list (void){    char *target;    vfs_path_t *target_vpath;    target = hotlist_show (LIST_VFSLIST);    if (!target)        return;    target_vpath = vfs_path_from_str (target);    if (!do_cd (target_vpath, cd_exact))        message (D_ERROR, MSG_ERROR, _("Cannot change directory"));    vfs_path_free (target_vpath);    g_free (target);}
开发者ID:NoSeungHwan,项目名称:mc_kor_dev,代码行数:16,


示例25: path_trunc

const char *path_trunc (const char *path, size_t trunc_len){    vfs_path_t *vpath;    char *secure_path;    const char *ret;    vpath = vfs_path_from_str (path);    secure_path = vfs_path_to_str_flags (vpath, 0, VPF_STRIP_PASSWORD);    vfs_path_free (vpath);    ret = str_trunc (secure_path, trunc_len);    g_free (secure_path);    return ret;}
开发者ID:JBurant,项目名称:mc,代码行数:16,


示例26: START_PARAMETRIZED_TEST

/* *INDENT-OFF* */START_PARAMETRIZED_TEST (test_path_length, test_path_length_ds)/* *INDENT-ON* */{    /* given */    vfs_path_t *vpath;    size_t actual_length;    vpath = vfs_path_from_str (data->input_path);    /* when */    actual_length = vfs_path_len (vpath);    /* then */    mctest_assert_int_eq (actual_length, data->expected_length);    vfs_path_free (vpath);}
开发者ID:ActionLuzifer,项目名称:mc,代码行数:18,



注:本文中的vfs_path_from_str函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vfs_read函数代码示例
C++ vfs_path_free函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。