씨언어 #define ALL_ATTRIB (FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_LABEL|FA_DIREC|FA_ARCH) 그리고 <-----이게 뭐하는거지요??

seojh1431의 이미지

씨쁠쁠로 코딩 되어 있는것을 씨로 고치는 중입니다만..(씨와 얼추 비슷하지만 씨쁠쁠이라고 판단하게된 이유는 microsoft visual C++2010 에서 돌려봤을때 빨간 줄 뜨는것을 보니.. 꽤 많았습니다.) 잘 모르는 헤더파일과 모르는 함수들이 많이 있더라구요.... 코드 보시고 제가 모르는 코드를 주석처리 해놨는데 그것좀 가르쳐주세요.. 메인함수도 없는걸 보니... 메인함수는 제가 직접 코딩하고 있씁니다.

#include "stdio.h"
#include "dos.h"
#include "dir.h"    //여기서 열수 없는 헤더파일이라고 나오네요.. 이건 뭐하는것이죠??
 
#define MAXPATH 80
#define ALL_ATTRIB (FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_LABEL|FA_DIREC|FA_ARCH)     // 무슨 정의인지 잘 모르겠씁니다..
 
int countFile;
 
void findfile (char *mask)
{
	char path[MAXPATH]; /* 현재 경로를 저장할 공간 */
	struct ffblk info;            // 여기서 오류가 뜨는데 무슨 의도인지 잘 모르겠네요
 
	/* 현재 디렉토리에서 파일 마스크에 해당하는 파일을 모두 찾음 */
	if (findfirst(mask, &info, ALL_ATTRIB) == 0)      // ALL_ATTRIB 이게 오류가 뜹니다...findfirst는  _findfirst 라고 변경하고                                                                                                                    // typedef struct _finddata_t FILE_SEARCH; 라고 제일 위에 처리 해주니 오류가 안뜨더군요.
	{
		do {
			getcwd(path, MAXPATH); /* 현재의 경로를 얻음 */
 
			printf ("\nTEST MASK {%d} : {%s}", countFile++, mask); /* TEST */
 
			printf ("\n%s%s%s\n", path, /* 출력 : 현재의 경로 + (\) + 파일명 */
				strlen(path) == 3 ? "" : "\\", info.ff_name);
			/* root \ sub */
		} while(findnext(&info) == 0);
	}
 
	/* 모든(*) 디렉토리를 검색 */
	if (findfirst("*", &info, FA_DIREC) == 0)
	{
		do {
			if (info.ff_name[0] == '.' || info.ff_attrib != FA_DIREC)
				continue;
			/* .(자신)와 ..(상위)를 배제하고 디렉토리(FA_DIREC 버그)인지 확인 */
 
			chdir(info.ff_name); /* 서브 디렉토리로 추적 */
			findfile(mask); /* 재귀 호출 (파일 찾고 서브 디렉토리 추적) */
			chdir (".."); /* 상위 디렉토리로 돌아옴 */
		} while(findnext(&info) == 0);
		/* 다음 디렉토리를 찾는다 */
	}
}

즉, 이 코드에서 주석처리해놓고 잘 모르겠다고 표시가 된것이 있는데 그 표시 된 함수가 뭐하는건지.. 그리고 씨언어로는 어떻게 바꿔야되는지좀 가르쳐주세요

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.