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);
    }
}



?

  1. [android] 초간단 얼럿 (AlertDialog)

  2. [ios] 문자열로 함수 실행하기 (eval 함수처럼)

  3. [ios] Thread Loop 내에서 UI 업데이트 방법

  4. [ios] URL 랜딩 속도(OpenURL 10초 정지되는) 이슈

  5. [linux] CentOS Apache 웹서버에 HTTPS 적용

  6. [ios] GMT Date와 Local Date 변환하기

  7. [js] e.stopPropagation() VS e.preventDefault ()

  8. [ios] 비동기 블럭 코드 예제

  9. [Android Error] The number of method references in a .dex file cannot exceed 64K

  10. [c] 파일명 또는 특정 패턴을 적용

  11. 캘리포니아 운전면허 족보

  12. 리팩토링 계획안

Board Pagination Prev 1 ... 62 63 64 65 66 67 68 69 70 71 Next
/ 71