FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DIRECTORYRECURSE()
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
DIRECTORYRECURSE()
Posted: Thu Feb 24, 2011 03:15 PM

Hi,
With this first command

aDir := DIRECTORYRECURSE( "." )

I do not load into aDir array files without extensions

in this way instead

aDir := DIRECTORYRECURSE( "*" )
all files are loaded
Is it normal?
best regards

marco

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DIRECTORYRECURSE()
Posted: Thu Feb 24, 2011 07:14 PM
Works fine for me using latest xHarbour from SVN. This is a sample:

Code (fw): Select all Collapse
#include "Directry.ch"


FUNCTION MAIN()

    LOCAL aDir := DIRECTORYRECURSE( "*.*" )

    LOCAL i

    FOR i = 1 TO LEN( aDir )
        ? aDir[ i, F_NAME ]
    NEXT

    INKEY( 0 )

    RETURN NIL


EMG
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: DIRECTORYRECURSE()
Posted: Fri Feb 25, 2011 09:44 AM

Marco,

can confirm this behaviour and I think it's logical, because the pattern "." is not suitable for files without extensions in opposite to "*" :idea:

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: DIRECTORYRECURSE()
Posted: Fri Feb 25, 2011 04:58 PM

frose,
please try these two different commands from any folder in any volume

DIR . /S
DIR * /S

and count the files listed

note that the numbers of files listed are the same.
In a program these two different ways to call the same function

aDir := DIRECTORYRECURSE( "." )

aDir := DIRECTORYRECURSE( "*" )

return different array if are present files without extension

Something is not working and
EMG confirms that in the latest version this problem has been fixed
bye

Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: DIRECTORYRECURSE()
Posted: Fri Feb 25, 2011 05:27 PM

Sorry, I was wrong. I didn't have any file without extension. :-)

EMG

Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: DIRECTORYRECURSE()
Posted: Fri Feb 25, 2011 06:41 PM

Marco,

yes, you are right. The default pattern is "." for all available files (and directories), also for files with no extension!

It works for Directory() but for DirectoryRecurse() the files with no extension are NOT included!

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 35
Joined: Sun Aug 29, 2010 12:44 PM
Re: DIRECTORYRECURSE()
Posted: Sun Feb 27, 2011 01:34 PM
MarcoBoschi wrote:frose,
please try these two different commands from any folder in any volume

DIR *.* /S
DIR * /S

and count the files listed


note that the numbers of files listed are the same.
In a program these two different ways to call the same function

aDir := DIRECTORYRECURSE( "*.*" )

aDir := DIRECTORYRECURSE( "*" )

return different array if are present files without extension

Something is not working and
EMG confirms that in the latest version this problem has been fixed
bye


Yes, I confirm this is a bug and it has been corrected now.
Andi
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: DIRECTORYRECURSE()
Posted: Fri Sep 16, 2011 10:16 AM

Hi Andy,

has been corrected ?

Best regards,

Felix

Continue the discussion