Contents

조회 수 792 댓글 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. [pdf] C 국제 표준 문서

    Date2013.04.23 CategoryDevelop Byhooni Views6747
    Read More
  2. [js] 윈도우 시작버튼처럼 나오는 메뉴

    Date2013.04.23 CategoryDevelop Byhooni Views6745
    Read More
  3. [c] 소켓주소 구조체에 대해..

    Date2003.04.23 CategoryDevelop Byhooni Views6739
    Read More
  4. [js] 이벤트 핸들러(Event Handlers)

    Date2003.04.23 CategoryDevelop Byhooni Views6731
    Read More
  5. [js] 가운데 새창 뜨는 함수와 이벤트

    Date2003.04.23 CategoryDevelop Byhooni Views6726
    Read More
  6. [c] 서비스 거부 공격(DoS;Denial of Service) 간단 소스.. ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views6721
    Read More
  7. [php] 서버 이상 체크 해서 문자보내는 샘플소스..

    Date2013.04.23 CategoryDevelop Byhooni Views6698
    Read More
  8. [c++] 헤더, 소스 파일 분리해서 작성해본 테스트 소스

    Date2013.04.23 CategoryDevelop Byhooni Views6694
    Read More
  9. [java] 스윙(swing) 인터페이스 이용해서 만든 구구단.. ㅋㅋ

    Date2003.04.23 CategoryDevelop Byhooni Views6684
    Read More
  10. [c] alarm()함수 설명과 간단한 예제

    Date2013.04.23 CategoryDevelop Byhooni Views6684
    Read More
  11. [c] 컴파일러 선행처리기 따라하기..

    Date2003.04.23 CategoryDevelop Byhooni Views6683
    Read More
  12. [js] 스타크래프트(starcraft)..

    Date2013.04.23 CategoryDevelop Byhooni Views6644
    Read More
Board Pagination Prev 1 ... 46 47 48 49 50 51 52 53 54 55 ... 71 Next
/ 71