viewdir

성명  
   찬밥 ( Vote: 168 )
File #1      qDecoder-6.0.tar (1.38 MB)   Download : 130
분류      잡담

#include <stdio.h>

#include "qDecoder.h"

#include <unistd.h>

#include <sys/stat.h>

#include <dirent.h>



int main(void) {



char *dir,fulldir[255], fullfile[255];

DIR *dirp;

struct dirent *dent;

struct stat fileinfo;

dir = qValue("dir");

if (!dir) qError("input directory path");



dirp = opendir(dir);

if(!dirp) qError("Can't reading directory");



qContentType("text/html");



printf("<HTML>\n\n");

printf("<HEAD><TITLE> Directory viewer </TITLE> </HEAD>\n\n", dir);

printf("<BODY>\n\n");

printf("<HR WIDTH = 600 ALIGN=left><BR> \n\n");



strcpy(fulldir, dir);

if (dir[strlen{dir} - 1] != '/') strcat(fulldir, "/");



while (dent = readdir(dirp)) {



sprintf(fullfile, "%s%s", fulldir, dent ->d_name);

stat(fullfile, &fileinfo);



if (S_ISDIR(fileinfo.st_mode)) {

printf(" D\t");

printf("<A HREF=\"viredir.cgi?dir=%s%s\">%-20s</A>

fulldir, dent ->d_name, dent ->d_name);



}

else {

printf(" \t");

printf("% -20s ",dent ->d_name);

}





printf("%s", ctime(&fileinfo.st_mtime));

}





closedir(dirp);

printf(" <PRE> \n\n");



printf(" <FORM ACTION=viewdir.cgi METHOD=post>\n");

printf(" <SMALL> <b> Directory </B> </SMALL> :\n");

printf(" <INPUT NAME=dir SIZE=30 VALUE=\"%s\">\n,fulldir);

printf(" </FORM>\n\n");



printf("</BODY>\n\n");

printf("</HTML>");



qFree();

}







compile :



gcc viewdir.c qDecoder.c -o viewdir.cgi









본문 내용은 8,824일 전의 글로 현재의 관점과 다를 수 있습니다.

Post: https://achor.net/board/freeboard/63
Trackback: https://achor.net/tb/freeboard/63

카카오톡 공유 보내기 버튼 LINE it! 밴드공유 Naver Blog Share Button
Please log in first to leave a comment.


Tag


 4388   220   214
No
분류
파일
제목
성명
작성일
128 Download: 173, Filesize: 1.38 MB        Re 2: 아처.. 꼭 보기바란다... 상아 2000/10/26
127잡담Download: 130, Filesize: 1.38 MB    viewdir 찬밥 2000/12/29
126영상Download: 37, Filesize: 1.38 MB    raging waves klover 2000/09/23
125 Download: 98, Filesize: 1.38 MB          Re 3: Over the rainbow... daybreak 2001/04/23
124 Download: 107, Filesize: 1.38 MB    아처님의 비밀을 찾았어요. reomi 2001/05/16
123 Download: 109, Filesize: 1.38 MB    하나 더! reomi 2001/05/16
122 Download: 115, Filesize: 1.38 MB    238120 919 2085 11525? applefile 2000/06/07
121 Download: 122, Filesize: 1.38 MB    Diablo II -Screenshot- 2 handsome 2000/07/27
120 Download: 124, Filesize: 1.38 MB    Diablo II -Screenshot- handsome 2000/07/27
119 Download: 127, Filesize: 1.38 MB    Diablo II -Screenshot- 3 handsome 2000/07/27
118 Download: 315, Filesize: 1.38 MB    스탈 [8] 2003/06/29
117 Download: 88, Filesize: 1.38 MB    직접 업로드 합니다. 김신갑 2000/05/13
116 Download: 84, Filesize: 1.38 MB    세 번째 배너입니다. ^^ 김신갑 2000/05/13
115 Download: 85, Filesize: 1.38 MB    두번째 배너 입니다. ^^ 김신갑 2000/05/13
114 Download: 83, Filesize: 1.38 MB    네 번째 배너입니다. 김신갑 2000/05/13
113 Download: 84, Filesize: 1.38 MB    마지막 입니다. 광고한것 같아서 미안하네요. 김신갑 2000/05/13
112유틸Download: 118, Filesize: 1.38 MB              Re 5: swish 1.01 achor 2000/10/24
111유틸Download: 171, Filesize: 1.38 MB    swish 1.5 achor 2000/09/19
110유틸Download: 146, Filesize: 1.38 MB                Re 6: swish 1.51 achor 2000/10/25
109 Download: 133, Filesize: 1.38 MB    븅신 ^ 광고 사타구니 2000/04/15
    210  211  212  213  214  215  216  217  218  219     

  당신의 추억

ID  

  그날의 추억

Date  

First Written: 11/06/1999 04:17:00
Last Modified: 02/10/2025 21:13:08