차근차근/C 83

파일 검색 소스

http://koronaii.tistory.com/15 ==================================================================== 파일검색 소스. 검색을 원하는 폴더를 path로 넣으면, 하위폴더까지 전부 검색해서 출력한다. =====================================================================01void FileList(char *path)02{03 HANDLE hSrch;04 WIN32_FIND_DATA wfd;05 BOOL bResult = TRUE;06 char drive[_MAX_DRIVE] = {0,};07 char dir[MAX_PATH] = {0,};08 char newpath[MAX_PA..

차근차근/C 2014.11.24

[UNIX] 디렉토리함수 opendir(), readdir(), closedir(), lstat()

검색어 : opendir readdir c++http://golee07.tistory.com/80 오늘은 디렉토리 관련 함수를 다루어 볼까 합니다. 디렉토리 안에는 일반적으로 파일이 보관되어 있습니다. 이미 알고 계시듯이 유닉스계열에서는 모든것을 파일로 취급합니다. 일반파일은 물론이고 하드디스크나 USB 같은 디바이스, 그리고 네트웍 인터페이스도 파일로 취급할 수 있습니다. (자세한 내용은 제 블로그의 리눅스이야기 부분을 참고하시기 바랍니다 ^^) 이렇듯 모든것을 파일로 취급할때 얻을수 있는 장점은 일관된 프로그래밍 인터페이스를 가지고 접근할 수 있다는것입니다. 즉, 리눅스에서는 일반파일에 입출력을 하는것이나 네트웍을 이용하는 것이나 일관되게 open() / read() / write() / close(..

차근차근/C 2014.11.20

<io.h> _finddata_t 구조체

http://xiasonic.tistory.com/143 #include #include #include #include void main( void ) { struct _finddata_t c_file; /* 위에서 struct _finddata_t 는 MS사에서 제공하는 구조체 자료형으로서 파일 정보 관리를 위한 자료형 입니다. _finddata_t라는 자료형은 io.h에 아래와 같이 6개의 필드를 갖는 구조체 자료형으로 정의되어져 있습니다. struct _finddata_t { unsigned attrib; // 파일 속성 기억용 필드 time_t time_create; // 파일을 만든 시간(지원하지 않음: 항상 -1값 가짐) time_t time_access; // 파일을 마지막으로 처리한 시간..

차근차근/C 2014.11.19

하위폴더 파일 출력 / CFileFind Class

재귀적으로 디렉토리를 탐색해나가는 MSDN 예제CFileFind 클래스를 이용 http://msdn.microsoft.com/ko-kr/library/scx99850(v=vs.80).aspx //http://msdn.microsoft.com/ko-kr/library/scx99850(v=vs.80).aspx//릴리즈 모드에서 실행 #include #include using namespace std; void Recurse(LPCTSTR pstr){ CFileFind finder; // build a string with wildcards CString strWildcard(pstr); strWildcard += _T("\\*.*"); // start working for files BOOL bWorking..

차근차근/C 2014.11.19

fatal error LNK1169: 여러 번 정의된 기호가 있습니다.

http://www.gpgstudy.com/forum/viewtopic.php?t=5895&sid=2d46b8eea23503ea04aeb11b9a9955ed 1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)이(가) LIBCMTD.lib(new.obj)에 이미 정의되어 있습니다.1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)이(가) LIBCMTD.lib(dbgdel.obj)에 이미 정의되어 있습니다.1>C:\uk1\vb2010\opencv2010\Deb..

차근차근/C 2014.11.19

비주얼 스튜디오에서의 dirent.h 의 사용

http://roughexistence.tistory.com/312 비주얼 스튜디오 2005 부터는 dirent.h 가 존재 하지 않는다. 리눅스에서 작성한 코드를 윈도우로 포팅할때 문제가 되는 부분이다.어지간하면 win32api 를 이용하는것이 좋은 방법이긴하지만 시간과 노력에 허덕이는 개발자들에겐 일일히 구현하기란 야근하고 퇴근해서 씻는것만큼이나 귀찮은 일이다. 일단 공개로 구현된 헤더가 존재하기에 링크. dirent-1.11.zip dirent-1.13.zip http://www.softagalleria.net/dirent.php 파일 링크:http://www.softagalleria.net/download/dirent/ ---------다운받은 후에 소스코드 있는 폴더에 넣은 후 # include..

차근차근/C 2014.10.23

리눅스(유닉스) 파일목록(하위디렉토리포함)구하기

http://blog.daum.net/odega/61 리눅스나 유닉스에서 백업프로그램을 짤때 기본이 되는 파일목록을 구하는 함수이다.아래소스는 하위디렉토포함 파일목록을 구하는 간단한 클래스다. ※VC++, C, C++ 코딩습관이 섞여있어서 미안하다. 그래도 리눅스는 물론이고 유닉스 시스템에서도 무리없이 컴파일 될것이다. #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef map FILE_LIST; class CFileList { public: CFileList(); ~CFileList(); public: bool ..

차근차근/C 2014.10.22
반응형