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
41 Develop 리팩토링 계획안 file hooni 2017.05.15 751
40 Develop [ios] 앱에서 설정화면 호출하기 hooni 2015.04.07 747
39 Develop [ios][swift] 초간단 TableView 샘플 file hooni 2016.06.27 740
38 Develop 캘리포니아 운전면허 족보 file hooni 2017.06.12 739
37 Develop [ios] Crashlytics, Fabfic 설치/설정 hooni 2016.07.21 730
36 Develop [Javascript][Ajax] 자바스크립트 강의 산출물 file hooni 2019.10.05 704
35 Develop [android] Android N requires the IDE to be running with Java 1.8 or later 오류 hooni 2016.08.30 690
34 Develop [ios] 비디오,네트워크,소셜로그인 테스트 file hooni 2017.04.04 689
33 Develop [matlab] 정보은닉 스테가노그래피(Steganography) 수업 file hooni 2016.10.03 684
32 Develop 정리할 자료. file hooni 2015.07.02 679
31 Develop [js] Text 값을 클립보드에 복사하기 hooni 2020.10.10 679
30 Develop Aspect Oriented Programming in Objective-C hooni 2015.05.18 676
29 Develop [swift] 실행시간 측정하기 hooni 2021.09.14 676
28 Develop [ios] 여러 버전의 Xcode 사용하기 hooni 2022.05.28 673
27 Develop [ios] Touch ID 적용 샘플 코드 (예제) file hooni 2015.02.23 670
26 Develop [ios] WWDC 2015 샘플 소스 코드 통합파일 hooni 2015.07.20 663
Board Pagination Prev 1 ... 49 50 51 52 53 Next
/ 53