MFC/TIP
_splitpath() : 경로 분리시키기...
Gungume
2006. 10. 5. 11:51
_splitpath() 함수를 사용하면 전체경로에 대해서 드라이브명, 경로, 파일명, 확장자로 구분해준다.
함수의 원형은 아래와 같다...
각 인자에 대한 MSDN의 설명을 보면 아래와 같다...
- 사용예 -
MSDN 원문 보기...
함수의 원형은 아래와 같다...
void _splitpath(
const char *path,
char *drive,
char *dir,
char *fname,
char *ext
);
각 인자에 대한 MSDN의 설명을 보면 아래와 같다...
path : Full path
(분리 시킬 경로의 절대경로...)
drive : Optional drive letter, followed by a colon (:)
(드라이브...)
dir : Optional directory path, including trailing slash. Forward slashes ( / ), backslashes ( \ ), or both may be used.
(드라이브와 파일명을 제외한 경로...)
fname : Base filename (no extension)
(확장자를 제외한 파일명...)
ext : Optional filename extension, including leading period (.)
( '.'을 포함한 확장자...)
- 사용예 -
_splitpath("C:/Documents and Settings/gungume/바탕 화면/Console/Console.dsw", drive, dir, fname, ext);- 결과 -
Drive : C:
Dir : /Documents and Settings/gungume/바탕 화면/Console/
Fname : Console
Ext : .dsw
MSDN 원문 보기...