묻고답하기

c ,php가 가능한 프로그래머 입니다.
예전 게시판을 마이그레이션 할 수 있는 방법을 알고 싶습니다...

오픈소스 이용에 감사 드립니다.

 more convGDBM2ASC.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

#include "gdbm.h"
#include "qDecoder.h"

#define TRUE    (1)
#define FALSE   (0)

void main(int argc, char **argv) {
  GDBM_FILE dbf;
  FILE *fp;
  datum key, nextkey, data;
  char *encdata;
  char gdbmpath[0xff], ascpath[0xff];
  int  progress;

  if(argc != 3) {
    printf("Usage : convGDBM2ASC DB_PATH ASC_PATH\n");
    printf("ex) convGDBM2ASC data/test.gdbm data/test.asc\n");
    printf("ex) convGDBM2ASC /htdocs/abcd.gdbm abcd.asc\n");
    exit(1);
  }

  strcpy(gdbmpath, argv[1]);
  strcpy(ascpath, argv[2]);

  /* DB open */
  dbf = gdbm_open(gdbmpath, 0, GDBM_READER, 0, NULL);
  if(dbf == NULL) {
    printf("There is no gdbm database file in this path(%s).\n", gdbmpath);
    exit(1);
  }

  /* File open */
  fp = fopen(ascpath, "wt");
  if(fp == NULL) {
    printf("File(%s) open fail.\n", ascpath);
    exit(1);
  }

  /* Main */
  printf("-- GDBM -> ASCII indian converting.\n");
  printf("-- Designed for 'CrazyWWWBoard'\n");
  printf("-- Target GDBM  file : %s\n", gdbmpath);
  printf("-- Saved  ASCII file : %s\n", ascpath);
  printf("\n");
  printf("Converting progress.\n");


  key = gdbm_firstkey(dbf);
  for(progress = 1; key.dptr != NULL; progress++) {
    data = gdbm_fetch(dbf, key);
    encdata = qURLencode(data.dptr);

    /* save */
    fprintf(fp, "%s=%s\n", key.dptr, encdata);

    /* progress status */
    printf(".");
    if(progress % 60 == 0) printf("\n");

    /* find next */
    nextkey = gdbm_nextkey(dbf, key);

    free(key.dptr), free(data.dptr), free(encdata);

    key = nextkey;
  }

  printf("\n");
  printf("Converted %d keys.\n", progress);
  printf("Converting completed.\n");

  /* close */
  fclose(fp);
  gdbm_close(dbf);
}

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
구가 db명은 따로 하고 회원정보만 공유하는 법 [2] 2010.06.21 by 구가
구가 닉네임을 한글로만 가능하게 하고 싶습니다 [1] 2010.06.21 by 구가
파워돌 다른서버 2군대 db 공용 페이지에서 로그인 섹션공유부분요  
뻑뻐기 외부페이지를 index.html로 나오게 하려면 어떻게 하나요? [1] 2010.06.21 by burster
이춘식 DQ 갤러리 이전  
메띄기 ''페이지에 오류가 있습니다'' [2] 2010.06.20 by fsfsdas
섹시보이 ssl 사용함으로바꿨다 모든게안됨  
Hilarity 자료실 모듈에서 자료를 등록할 때 오류가 납니다.  
수니웹 죄송하지만 외부 접속 되나 확인좀 부탁 드릴께욤 [1] 2010.06.20 by SMaker
윌로우피페 모바일로 xe 사이트 볼때 이미지도 목록에 나타나게 할수 없나요?  
ooni 글을 읽을 때에 날짜제한을 걸 수 없을까요?  
이상철623 게시판 권한  
StorM1 제로보드xe레이아웃 그누보드 레이아웃으로 바꾸는법,..  
youngs83 javascript 에서 내장객체의 class파일들의 실제위치를 알려주세요.  
misty353 주메뉴와 서브메뉴1을 같은 페이지가 나오게 하는방법? [1] file 2010.06.20 by syslong
edisonorg XE 정상 설치 완료 후 브라우저 새로 띄우면 로그아웃창에어 더이상 않됨. [2] file 2010.06.20 by edisonorg
바오밥T 이미지출력 페이지에서 대상모듈 추가시 생성되는 more 안나타나게? [1] file 2010.06.20 by 오르막
괴적인격 명언위젯 [2] 2010.06.20 by 오르막
죽강 대용량화일 업로드는 되는데 다운로드가 안되는 이유?  
섹시보이 게시판이나 사진첩 글쓰기 할때요.등록할때오류 [1] 2010.06.20 by xe-m