File Listing To Arrays
#6
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
Reply


Messages In This Thread
File Listing To Arrays - by SMcNeill - 04-20-2022, 02:22 AM
RE: File Listing To Arrays - by mpgcan - 05-14-2022, 04:44 PM
RE: File Listing To Arrays - by SMcNeill - 05-14-2022, 05:15 PM
RE: File Listing To Arrays - by mnrvovrfc - 03-23-2023, 07:39 PM
RE: File Listing To Arrays - by SpriggsySpriggs - 03-23-2023, 08:16 PM
RE: File Listing To Arrays - by SMcNeill - 03-23-2023, 08:18 PM
RE: File Listing To Arrays - by mnrvovrfc - 03-23-2023, 08:58 PM
RE: File Listing To Arrays - by Petr - 03-25-2023, 07:55 PM



Users browsing this thread: 5 Guest(s)