카테고리 없음

[Win32API] PathFileExists() 파일 존재 유무

쪽제비 2016. 8. 1. 11:04

사용 계기 

 - 필요한 *.ini 파일 존재 하는지 확인이 필요해서


Syntax 

BOOL PathFileExists(
  _In_ LPCTSTR pszPath
);

pszPath : 확인하고자 하는 파일 경로



return 

TRUE : 파일 존재

FALSE : 그 외


Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 4.71 or later)

Unicode and ANSI names

PathFileExistsW (Unicode) and PathFileExistsA (ANSI)

 - 사용하려면 헤더와 라이브러리 추가.


ex)

#include<Shlwapi.h>

#pragma comment(lib, "Shlwapi.lib")


출처 : https://msdn.microsoft.com/en-us/library/bb773584(v=VS.85).aspx