FUNCTION LfnFile(cF)
RETURN (File(cF))
FUNCTION LfnDirectory(cD)
RETURN (Directory (cD))
#INCLUDE "STRUCT.CH"
#DEFINE MAX_PATH 260
#DEFINE FILE_ATTRIBUTE_READONLY 1
#DEFINE FILE_ATTRIBUTE_HIDDEN 2
#DEFINE FILE_ATTRIBUTE_SYSTEM 4
#DEFINE FILE_ATTRIBUTE_DIRECTORY 16
#DEFINE FILE_ATTRIBUTE_ARCHIVE 32
#DEFINE FILE_ATTRIBUTE_NORMAL 128
#DEFINE FILE_ATTRIBUTE_TEMPORARY 256
******************************************************************************
DLL32 FUNCTION FINDFIRSTFILE(cFileName AS LPSTR,cFindFileData AS LPSTR) AS LONG PASCAL FROM "FindFirstFileA" LIB "kernel32.dll"
DLL32 FUNCTION FINDCLOSE(nFindFile AS LONG) AS BOOL PASCAL FROM "FindClose" LIB "kernel32.dll"
******************************************************************************
FUNCTION LFNFILE(cFile)
LOCAL oWin32FindData := OWIN32FINDDATA()
LOCAL hFile
hFile := FINDFIRSTFILE(cFile,oWin32FindData:cBuffer)
FINDCLOSE(hFile)
RETURN(hFile <> -1 .AND. NAND(oWin32FindData:nFileAttr,FILE_ATTRIBUTE_DIRECTORY) = 0)
******************************************************************************
STATIC FUNCTION OWIN32FINDDATA
LOCAL oWin32FindData
STRUCT oWin32FindDATA
MEMBER nFileAttr AS DWORD
MEMBER cCreatTime AS STRING LEN 10
MEMBER cLastATime AS STRING LEN 10
MEMBER cLastWTime AS STRING LEN 10
MEMBER nFileSizeH AS DWORD
MEMBER nFileSizeL AS DWORD
MEMBER nReserved0 AS DWORD
MEMBER nReserved1 AS DWORD
MEMBER cFileName AS STRING LEN MAX_PATH
MEMBER cShortName AS STRING LEN 14
ENDSTRUCT
RETURN(oWin32FindData)
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], wartiaga and 91 guests