Views 755 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
745 Develop [io] Apple Watch, Today Extension 앱ID 설정 hooni 2016.04.20 798
744 Develop [ios] Did UIScrollView End Scrolling? hooni 2016.04.19 1024
743 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Swift) file hooni 2016.03.23 7338
742 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C) file hooni 2016.03.23 1616
741 Develop [js] AngularJS 란? file hooni 2015.11.26 891
740 Develop [php] 한글 문자열 자르기 (utf-8) hooni 2015.11.10 1322
739 Develop [c] 한글 문자열 출력 hooni 2015.11.10 1680
738 Develop [ios] NavigationController 에서 왼쪽(back) 버튼 후킹하기 hooni 2015.10.23 1185
737 Develop [ios] ViewController Push할 때 애니메이션 효과 hooni 2015.10.23 875
736 Develop [linux] CentOS Apache 웹서버에 HTTPS 적용 hooni 2015.10.23 788
735 Develop [c] 기막힌 정렬 코드 ㅋㄷ file hooni 2015.10.13 812
734 Develop [ios] 상위 ViewController 가져오기 hooni 2015.10.12 958
733 Develop [ios] 최상위 ViewController 가져오기 hooni 2015.10.12 1064
732 Develop DDay Memo 1.9.4 소스코드 secret hooni 2015.10.03 0
731 Develop [ios] How to set up clang formatter hooni 2015.09.17 1362
730 Develop [ios] SBCampanion App 초안 file hooni 2015.09.16 658
Board Pagination Prev 1 5 6 7 8 9 ... 53 Next
/ 53