General information
Category:
Coding, syntax & commands
>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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only