Contents

조회 수 767 댓글 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. 프로그래밍에서 foo, bar 함수의 유래

    Date2013.06.25 CategoryDevelop Byhooni Views21283
    Read More
  2. [ios] PHP로 APNS 프로바이더~

    Date2013.06.27 CategoryDevelop Byhooni Views16865
    Read More
  3. [ios] APNS 클라이언트 구현 (pdf)

    Date2013.06.27 CategoryDevelop Byhooni Views15714
    Read More
  4. [ios] APNS 샘플 코드..

    Date2013.06.27 CategoryDevelop Byhooni Views0
    Read More
  5. [android] GCM 사용하기 1 (GCM 서비스 신청하기)

    Date2013.07.06 CategoryDevelop Byhooni Views51358
    Read More
  6. GCM 사용하기 2 (단말에 GCM 구현하기)

    Date2013.07.06 CategoryDevelop Byhooni Views23260
    Read More
  7. GCM 사용하기 3 (JSP로 GCM 푸시 서버 만들기)

    Date2013.07.06 CategoryDevelop Byhooni Views25324
    Read More
  8. git 브런치 배우기 (링크)

    Date2013.07.09 CategoryDevelop Byhooni Views20579
    Read More
  9. [ios] App States

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

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

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

    Date2013.08.08 CategoryDevelop Byhooni Views18716
    Read More
Board Pagination Prev 1 ... 43 44 45 46 47 48 49 50 51 52 ... 71 Next
/ 71