xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

GetVolInfo()

Retrieves the volume label of a disk.

Syntax

GetVolInfo( <cDrive> ) --> lSuccess

Arguments

<cDrive>
A single character, followed by a colon and backslash, specifies the disk drive to query. If omitted, the current drive is queried.

Return

The function returns the volume label of a disk as a character string, or a null string ("") in case of an error.

Info

See also:FileSeek(), VolSerial(), Volume()
Category: CT:DiskUtil , Disks and Drives , xHarbour extensions
Source:ct\disk.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example lists the volume labels of all drives and displays them.

   PROCEDURE Main
      LOCAL cDrive, i, cLabel

      FOR i:=1 TO 26
         cDrive := Chr(64+i) + ":\"
         cLabel := GetVolInfo( cDrive )

         IF .NOT. Empty( cLabel )
            ? cDrive, cLabel
         ENDIF
      NEXT
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe