MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / Util_DoesFileExist

Method Util_DoesFileExist

source/script_autoit.cpp:1742–1767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1740
1741
1742bool Line::Util_DoesFileExist(LPCTSTR szFilename) // Returns true if file or directory exists.
1743{
1744 if ( _tcschr(szFilename,'*')||_tcschr(szFilename,'?') )
1745 {
1746 WIN32_FIND_DATA wfd;
1747 HANDLE hFile;
1748
1749 hFile = FindFirstFile(szFilename, &wfd);
1750
1751 if ( hFile == INVALID_HANDLE_VALUE )
1752 return false;
1753
1754 FindClose(hFile);
1755 return true;
1756 }
1757 else
1758 {
1759 DWORD dwTemp;
1760
1761 dwTemp = GetFileAttributes(szFilename);
1762 if ( dwTemp != 0xffffffff )
1763 return true;
1764 else
1765 return false;
1766 }
1767}
1768
1769
1770

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected