03-23-2023, 08:18 PM
POSIX is generating a false flag for some reason for you. It happens sometimes, and I have no clue why.
IF flags AND IS_DIR THEN
DirCount = DirCount + 1
IF DirCount > UBOUND(DirList) THEN REDIM _PRESERVE DirList(UBOUND(DirList) + 100)
DirList(DirCount) = nam$
ELSEIF flags AND IS_FILE THEN
FileCount = FileCount + 1
IF FileCount > UBOUND(filelist) THEN REDIM _PRESERVE FileList(UBOUND(filelist) + 100)
FileList(FileCount) = nam$
END IF
When I first wrote this routine, we didn't have all the built-in commands which QB64 supports nowadays. Change those bold lines to the following and see if our native routines do the trick for you:
IF _DirExists(nam$) THEN...
ELSEIF _FileExists(nam$) THEN...
END IF
IF flags AND IS_DIR THEN
DirCount = DirCount + 1
IF DirCount > UBOUND(DirList) THEN REDIM _PRESERVE DirList(UBOUND(DirList) + 100)
DirList(DirCount) = nam$
ELSEIF flags AND IS_FILE THEN
FileCount = FileCount + 1
IF FileCount > UBOUND(filelist) THEN REDIM _PRESERVE FileList(UBOUND(filelist) + 100)
FileList(FileCount) = nam$
END IF
When I first wrote this routine, we didn't have all the built-in commands which QB64 supports nowadays. Change those bold lines to the following and see if our native routines do the trick for you:
IF _DirExists(nam$) THEN...
ELSEIF _FileExists(nam$) THEN...
END IF