Contents

조회 수 761 댓글 0
Atachment
첨부 '1'
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

사진 파일 정렬하고 차례대로 넘버링 하려고 만듦 ㅋㅋ


#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. git 브런치 배우기 (링크)

    Date2013.07.09 CategoryDevelop Byhooni Views20571
    Read More
  2. [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리

    Date2013.07.10 CategorySystem/OS Byhooni Views18798
    Read More
  3. 영어의 12 시제 (The twelve tenses of English)

    Date2013.07.12 CategoryEtc Byhooni Views15702
    Read More
  4. [ios] App States

    Date2013.07.22 CategoryDevelop Byhooni Views13195
    Read More
  5. [ios] Background 에서 네트워크 사용

    Date2013.07.22 CategoryDevelop Byhooni Views11510
    Read More
  6. [ios] 소소한 팁 (Rect,Point,Path,URL 등)

    Date2013.08.08 CategoryDevelop Byhooni Views29457
    Read More
  7. [ios] libxml/tree.h file not found

    Date2013.08.08 CategoryDevelop Byhooni Views18709
    Read More
  8. [ios] UI컨트롤러 샘플코드

    Date2013.08.08 CategoryDevelop Byhooni Views15425
    Read More
  9. [ios] 최신 UI 모음.. (나중에 정리할 것)

    Date2013.08.09 CategoryDevelop Byhooni Views0
    Read More
  10. 아이 훌레시 작업중 ㅋㅋ

    Date2013.08.09 CategoryDevelop Byhooni Views0
    Read More
  11. [web] 제로보드 XE 템플릿에서 if문에 대해서 알아봅시다

    Date2013.08.16 CategoryEtc Byhooni Views19817
    Read More
  12. 베지어 곡선 (Bezier curve)

    Date2013.08.18 CategoryEtc Byhooni Views221562
    Read More
Board Pagination Prev 1 ... 60 61 62 63 64 65 66 67 68 69 ... 98 Next
/ 98