ZTree.com  | ZEN  | About...  

 Index   Back

[Q] Skip Log [Up Arrow] Volumes?   [Q]

By: Ben Kent       
Date: May 09,2022 at 21:38
In Response to: [Q] Skip Log [Up Arrow] Volumes? (Dan LeGate)

> Cool, Ben! Yes, either of those as options would really help!
>
>
> > My guess is that the delay is when ZTree is trying to read the
> > used/free space.
> > If that is the case, a configuration option to stop it reading the
> > free/used space on the Log, Up command could be an option.
> >
> > Another possibility, is if the API that ZTree uses to make that list
> has
> > a timeout, then a configuration option to set a few seconds timeout,
> > would solve your problem.
> >
> >
> > These might give some clues, and also could be used outside of ZTree
> to
> > get the drives list.
> >
> >
> > Run these in powershell
> > Get-WMIObject -Class Win32_LogicalDisk
> > Get-PSDrive -PSProvider FileSystem
> > [System.IO.DriveInfo]::getdrives()
> >
> > These can be run in powershell or cmd
> > wmic volume get Caption
> > wmic LOGICALDISK get name,Description
> >
> > Ben


Dan

Did you try the various commands to see how they behave on the systems with the slow drives?

Once a slow drive has been accessed, are subsequent accesses quick?
i.e. are the drives asleep, and you need to wake them up, or are they just very slow?



Doing some more investigations

Looking at the Log, Up list. ZTree collects five pieces of information: Drive letter, drive type, size, free space and UNC for network drives.


Either ZTree is using these API's
GetLogicalDrives
GetLogicalDriveStringsW
GetDriveTypeA
GetDiskFreeSpaceA or GetDiskFreeSpaceExA

Which don't have timeouts, which means ZTree would have to create a thread for each drive, and have a timeout to wait for the result, which would complicate the code, and could possibly cause some problems.
If some are quick and some slow, then have a ZTree configuration option to make the Log, Up list, show only the fast information.


Or ZTree is calling WMI

Do these two Powershell commands take the same time, or is the first one quicker on the systems with the slow drive(s), especially for the first access?

Get-WMIObject -Query 'select DeviceID,DriveType from Win32_LogicalDisk'

Get-WMIObject -Query 'select DeviceID,DriveType,ProviderName,FreeSpace,Size from Win32_LogicalDisk'

If the first is quicker then the WMI command timer could be an option, see https://www.codeproject.com/Questions/118009/WMI-timeout, assuming that there is a C equivalent to the .Net ManagementOptions.Timeout.

If there is no C equivalent, but the first command is quicker, then the only option would be for a ZTree configuration option to make the Log, Up list, show only the fast information.

If there is a C equivalent, then ZTree would need a configuration option to set the timeout, and collect the information in two passes, a all drives query for the fast information, then a number of by drive letter with the timeout to try and read the slow information.



Ben

501 views      
 

Messages in this Thread

 
96,656 Postings in 12,233 Threads, 350 registered users, 70 users online (0 registered, 70 guests)
Index | Admin contact |   Forum Time: May 19, 2024 - 12:00 am UTC  |  Hits:63,528,051  (7 Today )
RSS Feed