Check whether the Drive is valid or not ?

Got a problem you cannot solve? Try here.
SITL
Posts: 116
Joined: Tue Sep 27, 2016 12:31 am

Check whether the Drive is valid or not ?

Postby SITL » Wed Jul 05, 2017 2:11 am

Dear Francesco,
For checking whether the Drive is valid or not,
Here is some work around...

Set Variable MYSPACE to
Set Variable MYPATH to D:\TestPath
Set Variable MYPATH_PARSED to

Parse String $MYPATH$ into Variables MYPATH_PARSED and (Split at first occurrence of pattern)

Get Total Space on $MYPATH_PARSED$ into variable MYSPACE

MYSPACE is Zero for invalid drive.

I feel, it's simpler than calling a library function & parsing.
Appreciate your comment.
Regards
SITL

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Check whether the Drive is valid or not ?

Postby FrancescoT » Wed Jul 05, 2017 5:00 am

Dear SITL,

you can even use your approach and then to consider "MYSPACE = 0" as an invalid drive. However, this only tells you if the specific target drive has space available and not if this exists.

Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 42 guests