BUG: ADIR() Returns Incorrect Volume Names

ID: Q122937

The information in this article applies to:

SYMPTOMS

The ADIR() function may return a blank or incorrect volume name in FoxPro for MS-DOS for a network or local drive if the volume label contains more than eight characters.

RESOLUTION

Use the Library Construction Kit (LCK) to create a .PLB that obtains the volume label.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To reproduce the problem, create and run a program containing the following lines of code:

   * show drives between C: and Z: that exist, get their volume name:
   m.startdrv = ASC("C")
   m.enddrv   = ASC("Z")
   m.olddefa = SYS(5)
   FOR i = m.startdrv TO m.enddrv
      m.testfile = CHR(i) + ":\NUL"
      string = CHR(i) + ':'
      DIMENSION temparray(1)
      IF FILE(m.testfile)
         SET DEFAULT TO CHR(i)
         = adir(temparray,'*.*','v')
         WAIT WINDOW "Drive: " + chr(i) + ;
            ": exists. Vol name is: "+temparray(1)
      ENDIF
   ENDFOR

FoxPro returns blank or incorrect volume names for network or local drives when the volume label contains more than eight characters.

REFERENCES

For more information about related problems with ADIR(), please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q98357
   TITLE     : FIX: ADIR() Doesn't Return Volume Label in FoxPro 2.5


Keywords          : FoxDos FxprgGeneral kbvfp260abug 
Version           : 2.6a
Platform          : MS-DOS
Issue type        : kbbug

Last Reviewed: May 29, 1997