Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR() Lost Functionality ?
Message
De
31/01/1997 08:37:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00018890
Message ID:
00018933
Vues:
35
>Some code we used in 2.6 to check Volume Labels of disks / services does not appear in the Help of VFP 3.0 / 5.0 Using example: ADIR(test,"C:\*.*","V") Tests in VFP 5.0 work only if cd C:\ before command is run. If you are in C:\temp and do not run cd, or run cd c:\temp before the command, it fails. Anyone know of another function to read the Volume Label. Looked in SYS() and didn't see one.
>TIA

You can use API function

FUNCTION GET_VOL

Parameter cDisque


cdisque = left(cdisque,1)+":\"

lpRootPathName = cdisque && Drive and directory path
*lpRootPathName = "A:\" && Drive and directory path
lpVolumeNameBuffer = SPACE(256) && lpVolumeName return buffer
nVolumeNameSize = 256 && Size of/lpVolumeNameBuffer
lpVolumeSerialNumber = 0 && lpVolumeSerialNumber buffer


lpMaximumComponentLength = 256
lpFileSystemFlags = 0
lpFileSystemNameBuffer = SPACE(256)
nFileSystemNameSize = 256

RetVal=GetVolInfo(@lpRootPathName, @lpVolumeNameBuffer, ;
nVolumeNameSize, @lpVolumeSerialNumber, ;
@lpMaximumComponentLength, @lpFileSystemFlags, ;
@lpFileSystemNameBuffer, nFileSystemNameSize)

if RetVal # 0
return left(alltrim(lpVolumeNameBuffer),len(alltrim(lpVolumeNameBuffer))-1)
endif


return .f.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform