Contents

Views 2404 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
73 Etc WM미통기 - 10. 조건부확률 hooni 2015.04.20 2248
72 Develop [ios] StoryBoard(xib) 없이 프로젝트 만들기 file hooni 2015.02.12 2228
71 Develop [c#] BHO 한샘툴바랑 동현툴바.. secret hooni 2013.04.23 2208
70 System/OS [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 hooni 2014.12.18 2195
69 Develop [ios] 아이폰 앱 이름 및 버전 정보 hooni 2015.03.24 2194
68 Develop [ios] 로컬에 있는 html 실행하기 hooni 2015.02.10 2181
67 Develop [js] AngularJS 란? file hooni 2015.11.26 2177
66 Develop [ios] 로컬에 있는 JS 파일 웹뷰에서 동적으로 실행하기 hooni 2015.02.10 2176
65 Develop [ios] Xcode의 디버그 모드에서 콜스택 file hooni 2015.01.03 2172
64 Develop [ios] APNS에 사용할 인증서 만들기 (KeyChain에 있는 인증서 Export) file hooni 2015.01.03 2141
63 Develop [c#] 툴바 최근 버전(IE6, IE7 두가지 버전) secret hooni 2013.04.23 2138
62 System/OS [mac] 패키지 매니저, MacPort hooni 2015.01.03 2137
Board Pagination Prev 1 ... 88 89 90 91 92 93 94 95 96 97 ... 99 Next
/ 99