Oris482 / Minishell

Create own shell(such as bash): by_jaesjeon, minsuki2
1 stars 1 forks source link

FEAT : 파일 문자 매칭하기 #17

Closed Giromi closed 2 years ago

Giromi commented 2 years ago
cc find_files.c word_matching.c dirent_utils.c ../my_func/about_alloc.c ../my_func/about_dir.c -I. -g

Screen Shot 2022-08-28 at 9 57 04 AM

Before (*.c)

Screen Shot 2022-08-28 at 9 58 19 AM

After (*.c)

image

Giromi commented 2 years ago

*/이 들어오면 내부 dir_flag켜주고 이름만 들어가야 함

Giromi commented 2 years ago

TEST CASE

int main(int ac, char *av[])
{
    t_file  *files;
    int     cnt;

    files = get_files_cur_pwd("/Users/minsuki2/Desktop/Minishell/lexer/test_dir", 1);
    printf("\n");
    printf("\n");
    for (int i = 0; i < files->n; i++)
    {
        if (i == 0)
            printf("files_n\t:\t%d\n", files[i].n);
        printf("name\t:\t%s\n", files[i].name);
        printf("mflag\t:\t%d\n", files[i].match_flag);
        printf("type\t:\t%d\n", files[i].type);
        printf("\n");
    }

    cnt = is_matching_file("test*/", files);

    printf("------------------------------------\nmatching cnt : %d\n\n", cnt);
    for (int i = 0; i < files->n; i++)
    {
        if (i == 0)
            printf("files_n\t:\t%d\n", files[i].n);
        printf("name\t:\t%s\n", files[i].name);
        printf("mflag\t:\t%d\n", files[i].match_flag);
        printf("type\t:\t%d\n", files[i].type);
        printf("\n");
    }
    // system("leaks -q a.out");
    return (0);
}
Giromi commented 2 years ago

Screen Shot 2022-08-29 at 10 46 29 AM

test*/탐색

Screen Shot 2022-08-29 at 10 46 43 AM

Screen Shot 2022-08-29 at 10 46 11 AM

Giromi commented 2 years ago

19