Bug in ADrives() [Fixed]

Bug in ADrives() [Fixed]

Postby Enrico Maria Giordano » Wed Apr 12, 2017 8:24 am

With latest W10 update the function ADrives() is no longer working. To fix the problem, please replace

Code: Select all  Expand view
FILE( CHR( i ) + ":\NUL" )


with

Code: Select all  Expand view
ISDISK( CHR( i ) )


Hope ISDISK() is available in Harbour too.

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

Re: Bug in ADrives()

Postby Antonio Linares » Wed Apr 12, 2017 5:11 pm

Enrico,

I just tested:
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   XBrowser( ADrives() )
   
return nil


And it is working fine with Windows 10 Pro, version 1703, OSBuild 15063.138

What Windows 10 version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 34826
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in ADrives()

Postby Enrico Maria Giordano » Wed Apr 12, 2017 5:30 pm

Antonio Linares wrote:Enrico,

I just tested:
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   XBrowser( ADrives() )
   
return nil


And it is working fine with Windows 10 Pro, version 1703, OSBuild 15063.138


What do you get? I get all the drives from C to Z after latest Windows update.

Antonio Linares wrote:What Windows 10 version are you using ?


Latest official: Windows 10 Pro 1607 14393.1066

Anyway, I think that using a specific function like ISDISK() is better than the old trick with NUL, isn't it?

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

Re: Bug in ADrives()

Postby Enrico Maria Giordano » Wed Apr 12, 2017 7:57 pm

Now I have the same Windows version of yours (1703 build 15063.138) and the problem is not fixed.

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

Re: Bug in ADrives()

Postby Antonio Linares » Thu Apr 13, 2017 7:26 am

What is exactly the problem ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 34826
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in ADrives()

Postby Enrico Maria Giordano » Thu Apr 13, 2017 8:31 am

The problem is that ADrives() should return (and did before the recent Windows updates) only the existing drives in the system. In my PC it did return C, D AND E while now it wrongly returns all the drives from C to Z. Using ISDISK() instead of the NUL trick fixed the problem for me.

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

Re: Bug in ADrives()

Postby Antonio Linares » Thu Apr 13, 2017 9:42 am

Could you post your code using ISDISK() ?

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 34826
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in ADrives()

Postby Enrico Maria Giordano » Thu Apr 13, 2017 9:59 am

Here it is:

Code: Select all  Expand view
function ADrives( nType )  // Thanks to EMG

   local aDisk := {}
   local i

   DEFAULT nType := 0

   if nType = 0 .OR. nType = 1
      for i = ASC( "A" ) TO ASC( "B" )
          if ISDISKETTE( CHR( i ) + ":" )
             AADD( aDisk, CHR( i ) + ":" )
          endif
      next
   endif

   if nType = 0 .OR. nType = 2
      for i = ASC( "C" ) TO ASC( "Z" )
          if ISCDROM( CHR( i ) + ":" ) .OR. ISDISK( CHR( i ) )
             AADD( aDisk, CHR( i ) + ":" )
          endif
      next
   endif

return aDisk


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

Re: Bug in ADrives()

Postby Antonio Linares » Thu Apr 13, 2017 11:08 am

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 34826
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in ADrives()

Postby Enrico Maria Giordano » Mon May 08, 2017 12:17 pm

Antonio,

you forgot to fix this in the latest FWH build. :-)

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

Re: Bug in ADrives()

Postby Antonio Linares » Mon May 08, 2017 5:00 pm

Enrico,

You are right

Already included for FWH 17.05

many thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 34826
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain



Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 1 guest