Contents

Views 2406 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. GPL, AGPL, MPL,.. 한눈에 보는 오픈소스SW 라이선스

  3. [js] 스크롤 이벤트 막기

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

  5. [c#] mfc 기반의 웹서비스 서버/클라이언트 샘플과 예제 소스

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

  7. [c#] MS IE(Internet Explorer) 툴바 버튼 예제 2003/2005 두가지 버전

  8. [maven] Mac OS에 메이븐(maven) 설치하기

  9. 정리할 자료.

  10. XE Core 1.8.18 본문 작성시 태그(html) 사라지는 버그

  11. [android] N-Puzzle 게임

  12. [ios] ViewController Push할 때 애니메이션 효과

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 99 Next
/ 99