DIRECTORYRECURSE()

DIRECTORYRECURSE()

Postby MarcoBoschi » Thu Feb 24, 2011 3: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: DIRECTORYRECURSE()

Postby Enrico Maria Giordano » Thu Feb 24, 2011 7:14 pm

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

Code: Select all  Expand view
#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
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DIRECTORYRECURSE()

Postby frose » Fri Feb 25, 2011 9: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
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: DIRECTORYRECURSE()

Postby MarcoBoschi » Fri Feb 25, 2011 4: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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: DIRECTORYRECURSE()

Postby Enrico Maria Giordano » Fri Feb 25, 2011 5:27 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: DIRECTORYRECURSE()

Postby frose » Fri Feb 25, 2011 6: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
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: DIRECTORYRECURSE()

Postby andijahja » Sun Feb 27, 2011 1: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
User avatar
andijahja
 
Posts: 35
Joined: Sun Aug 29, 2010 12:44 pm

Re: DIRECTORYRECURSE()

Postby Baxajaun » Fri Sep 16, 2011 10:16 am

Hi Andy,

has been corrected ?

Best regards,

Felix
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken, Silvio.Falconi and 132 guests