Views 748 Votes 0 Comment 0
Atachment
Attachment '1'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

사진 파일 정렬하고 차례대로 넘버링 하려고 만듦 ㅋㅋ


#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>

int main(){
    DIR *dir_info;
    struct dirent *dir_entry;
    char new_name[128];
    int i;

    //mkdir( "test_A"     , 0755);

    dir_info = opendir( ".");

    if ( NULL != dir_info){
        //while( (dir_entry = readdir( dir_info)) ){
        for(i =0; (dir_entry = readdir( dir_info)); i++){
            if( strstr(dir_entry->d_name, ".jpeg") > 0 ){
                printf( "%s\n", dir_entry->d_name);

                memset(new_name, 0x00, 128);
                sprintf(new_name, "IMG_%04d.JPG", i);
                rename(dir_entry->d_name, new_name);
            }
        }
        closedir( dir_info);
    }
}


?

List of Articles
No. Category Subject Author Date Views
729 Develop [ios] How to set up clang formatter hooni 2015.09.17 1357
728 Develop [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기 file hooni 2021.01.29 1379
727 Develop [ios] Swift 4 String, Date, DateFormatter 예제 hooni 2018.10.18 1394
726 Develop What is difference between Get, Post, Put and Delete? hooni 2018.02.28 1400
725 Develop [android] 레이아웃 사이즈 변경 (동적; programmatically) hooni 2016.11.07 1478
724 Develop [ios] Pod 특정 버전 설치하고 사용하기 hooni 2022.05.28 1521
723 Develop [ios] binary를 C코드로 변환 file hooni 2015.01.03 1525
722 Develop [python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs) hooni 2019.11.22 1549
721 Develop [ios] 스크린 캡쳐 (전원버튼 + 홈버튼) 호출 알아내기 hooni 2014.11.19 1556
720 Develop [ios] Swift 4 Singleton inheritance hooni 2018.10.31 1588
719 Develop [js] 모바일 스크롤 방지(해제) hooni 2015.04.14 1588
718 Develop [ios] Requesting Location Permissions in iOS file hooni 2018.08.18 1599
717 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C) file hooni 2016.03.23 1608
716 Develop [ios] Locale Identifiers file hooni 2018.11.29 1621
715 Develop ZBar 라이브러리를 이용한 바코드 스캔 앱 개발하기 file hooni 2015.01.01 1628
714 Develop [ios] 동영상 플레이어 샘플 (for Remote Url) file hooni 2017.02.07 1640
Board Pagination Prev 1 ... 6 7 8 9 10 ... 53 Next
/ 53