DIRECTORYRECURSE()

Post Reply
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

DIRECTORYRECURSE()

Post by MarcoBoschi »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: DIRECTORYRECURSE()

Post by Enrico Maria Giordano »

Works fine for me using latest xHarbour from SVN. This is a sample:

Code: Select all

#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
User avatar
frose
Posts: 327
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Gütersloh
Contact:

Re: DIRECTORYRECURSE()

Post by frose »

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:
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: DIRECTORYRECURSE()

Post by MarcoBoschi »

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
User avatar
frose
Posts: 327
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Gütersloh
Contact:

Re: DIRECTORYRECURSE()

Post by frose »

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!
User avatar
andijahja
Posts: 35
Joined: Sun Aug 29, 2010 12:44 pm

Re: DIRECTORYRECURSE()

Post by andijahja »

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
User avatar
Baxajaun
Posts: 853
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Re: DIRECTORYRECURSE()

Post by Baxajaun »

Hi Andy,

has been corrected ?

Best regards,

Felix
Post Reply