Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if path is local or remote
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00162674
Message ID:
00162789
Vues:
27
>My program needs to determine whether a given path points to a local disk drive or a network drive. I thought of simply looking for two slash marks at the beginning of the string, e.g., at("\\",m.string)<>0, but if the network directory had been assigned to a drive letter (e.g., d:), the expression would evaluate false.
>
>Is there an API call or any other means of determining this?
>
Hi Chris,

This depends on whether you're using VFP 6.0 or an earlier version. In VFP 6.0, you can use the DRIVETYPE() function. Prior versions can load the foxtools library and use the function. Here's the syntax and results:
* lcdrive is the drive letter, "C", "D", etc.
lnresult = DRIVETYPE(lcdrive)
* Return values are
* 0  No type (from Foxtools)
* 1  No type (VFP 6.0)
* 2  Floppy disk drive
* 3  Fixed hard disk drive
* 4  Network drive or other removable type
* 5  CD-ROM drive
* 6  RAM disk (Due to differing types, result may be inconsistent.)
hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform