Microsoft KB Archive/100554: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 58: Line 58:
== MORE INFORMATION ==
== MORE INFORMATION ==


ADIR() places information about all files in the current directory, or all files that match a file skeleton (such as &quot;*.DBF&quot;) into an array, then returns the number of matching files. For each file found, ADIR() places the name, size, date, time, and MS-DOS attributes in the specified array.<br />
ADIR() places information about all files in the current directory, or all files that match a file skeleton (such as "*.DBF") into an array, then returns the number of matching files. For each file found, ADIR() places the name, size, date, time, and MS-DOS attributes in the specified array.<br />
<br />
<br />
If the directory is empty or there are no matches for the file skeleton, ADIR() does not create the array.<br />
If the directory is empty or there are no matches for the file skeleton, ADIR() does not create the array.<br />
Line 65: Line 65:
<br />
<br />


<pre class="fixed_text">  =ADIR(FileInfo, &quot;C:\COMMAND.COM&quot;)
<pre class="fixed_text">  =ADIR(FileInfo, "C:\COMMAND.COM")
   DISPLAY MEMORY LIKE FileInfo
   DISPLAY MEMORY LIKE FileInfo
                 </pre>
                 </pre>
Line 77: Line 77:
<div class="indent">
<div class="indent">


( 1, 1) C &quot;COMMAND.COM&quot; ( 1, 2) N 52925 (52925.00000000) ( 1, 3) D 03/10/93 ( 1, 4) C &quot; 6:00:00&quot; ( 1, 5) C &quot;R....&quot;
( 1, 1) C "COMMAND.COM" ( 1, 2) N 52925 (52925.00000000) ( 1, 3) D 03/10/93 ( 1, 4) C " 6:00:00" ( 1, 5) C "R...."




Line 96: Line 96:
== REFERENCES ==
== REFERENCES ==


&quot;Language Reference,&quot; version 2.5, page L3-176<br />
"Language Reference," version 2.5, page L3-176<br />
<br />
<br />
Online Help, FoxPro 2.5 and 2.5a for Windows<br />
Online Help, FoxPro 2.5 and 2.5a for Windows<br />

Latest revision as of 13:21, 19 July 2020

Knowledge Base


INFO: Using ADIR() Function to Obtain MS-DOS File Information

Article ID: 100554

Article Last Modified on 2/22/2005



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft FoxPro 2.5b
  • Microsoft FoxPro 2.5a
  • Microsoft FoxPro 2.0
  • Microsoft FoxPro 2.5b for MS-DOS
  • Microsoft FoxPro 2.5a



This article was previously published under Q100554

SUMMARY

The ADIR() function can be used to return MS-DOS file information, such as a file's date, time, size, and attributes.

MORE INFORMATION

ADIR() places information about all files in the current directory, or all files that match a file skeleton (such as "*.DBF") into an array, then returns the number of matching files. For each file found, ADIR() places the name, size, date, time, and MS-DOS attributes in the specified array.

If the directory is empty or there are no matches for the file skeleton, ADIR() does not create the array.

The following sample code demonstrates the use of the ADIR() function to obtain file information for C:\COMMAND.COM:

   =ADIR(FileInfo, "C:\COMMAND.COM")
   DISPLAY MEMORY LIKE FileInfo
                



The DISPLAY MEMORY LIKE FileInfo command shows information similar to the following:

   FILEINFO         Pub      A
                

( 1, 1) C "COMMAND.COM" ( 1, 2) N 52925 (52925.00000000) ( 1, 3) D 03/10/93 ( 1, 4) C " 6:00:00" ( 1, 5) C "R...."




According to these results, COMMAND.COM is 52,925 bytes in size, its date is 3/10/93, its time is 6 A.M., and the Read-Only attribute is set.

NOTE: ADIR() can also be used to return a drive's volume name.

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Kevin Zollman, Microsoft Corporation.


REFERENCES

"Language Reference," version 2.5, page L3-176

Online Help, FoxPro 2.5 and 2.5a for Windows

Online Help, FoxPro 2.0, 2.5, and 2.5a for MS-DOS


Additional query words: VFoxWin FoxDos FoxWin 2.x command system hidden archive ADIR file akz

Keywords: kbinfo kbenv KB100554