kyuseo의 게임 프로그래밍

_fullpath() :: 상대 파일 경로를 절대 파일 경로로 변경 본문

C++ 개발

_fullpath() :: 상대 파일 경로를 절대 파일 경로로 변경

kyuseo 2007. 11. 28. 10:41

개요..

 

상대 경로의 파일 위치를 ( 예: ..\test.bmp, .\test.txt ) 절대 경로의 파일 위치(예:c:\kyuseo\test.bmp)로 변경할 경우 _fullpath() 함수를 사용합니다.

 

 

코드

 

함수 원형:

 

char *_fullpath(

char *absPath,

const char *relPath,

size_t maxLength

);

 

wchar_t *_wfullpath(

wchar_t *absPath,

const wchar_t *relPath,

size_t maxLength

);

 

 

예제:

 

    char full[_MAX_PATH];

 

    _fullpath( full, "ReadMe.txt", _MAX_PATH );

    // full == "C:\Documents and Settings\kyuseo\My Documents\ReadMe.txt"

 

    _fullpath( full, "..\\ReadMe.txt", _MAX_PATH );

    // full == "C:\Documents and Settings\kyuseo\ ReadMe.txt"