Contents

Views 893 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
153 Develop [c++] mfc이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트 file hooni 2013.04.23 9274
152 Develop [c++] mfc에서 윈도우 항상 위 속성 주기.. hooni 2013.04.23 11361
151 Develop [c++] mfc로 만든 현재 디렉토리 읽어오기/세팅하기 (GetCurrentDirectory/SetCurrentDirectory) file hooni 2013.04.23 8510
150 Develop [c++] mfc로 만든 인테리어 수납 시스템(2D기반 설계) file hooni 2013.04.23 7273
149 Develop [c++] mfc로 만든 월플렉스 멀티 수납 시스템(2D기반 설계) file hooni 2013.04.23 7426
148 Develop [c++] mfc로 만든 사용자 계정 리스트 출력(EnumUser) 프로그램 예제 file hooni 2013.04.23 7319
147 Develop [c++] mfc로 만든 부엌 수납 시스템(2D기반 설계) file hooni 2013.04.23 7288
146 Develop [c++] MFC로 만든 디렉토리/파일 파인더 file hooni 2013.04.23 9366
145 Develop [c++] mfc 파일 한줄씩 읽기.. ㅋㅋ hooni 2013.04.23 28637
144 Develop [c++] mfc 조건별 파일 검색 프로그램 소스 ㅋㅋ 19 file hooni 2013.04.23 11437
143 Develop [c++] mfc 이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트 file hooni 2013.04.23 8826
142 Develop [c++] mfc 이용한 기본적인 형변환 예제 hooni 2013.04.23 11502
Board Pagination Prev 1 ... 81 82 83 84 85 86 87 88 89 90 ... 98 Next
/ 98