ADIR() on Novell Requires a File Mask on the D Option

Last reviewed: June 27, 1995
Article ID: Q101290
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.5
  • Microsoft FoxPro for MS-DOS, versions 2.0 and 2.5

SUMMARY

Although the ADIR() function is network aware, when it is used with the D option to read a Novell network drive, you MUST use file masking in order to make Novell return the proper information. This file mask includes a drive letter (which is mapped in Novell) and a file extension. If a mask is not used, ADIR() will return a 0 (signifying a failure to find anything).

For example, the following function will return a 0 and the array "test" will be empty because no file masking is being used on mapped drive "X":

   ? ADIR(test,"X:","D")

However, this function will return the number of subdirectories because file masking is being used on mapped drive "X":

   ? ADIR(test,"X:\*.","D")

More Information:

The ADIR() function retrieves file and directory information for the specified skeleton into an array, and then returns the number of files. Information about each file or directory is placed in the array specified if the array exists. If the array does not exist, FoxPro automatically creates it. The third parameter of the ADIR() function is optional and is used to expand the search to include additional files or directories. The function returns the number of files that it finds or a 0 if the search was unsuccessful.

As mentioned above, the third parameter of the ADIR() function is used to expand the search to include additional information. If the third parameter passed is a "D", the information that is returned will be about all the subdirectories that are under the current directory or the skeleton (which can be optionally passed as the second parameter). The ADIR() function is also network aware, so it can be used to retrieve network file and directory information.


Additional reference words: FoxDos FoxWin 2.50 2.00 ADIR Novell novel
KBCategory: kbprg
KBSubcategory: FxnetworkNetware


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.