how to write a program that will behave much the same as the DIR command in DOS
Assume the help page of the dir command looks like this.
DIR [-a[attributes]] [-b] [-o[[:]sortorder]] [-p] [-q] [-t[[:]timefield]] [-w] [path] [filename/dirname]
[path] [filename] |
Specify directory, and-or file to list |
-a |
Display files with specific attributes |
[attributes] |
d directories r read only files h hidden files |
-b |
Use bare format (no heading information) |
-o |
List by files in sorted order. |
[sortorder] |
n by name (alphabetic) s by size g group directories d by date-time (oldest first) |
-p |
Pause after each successful (24 lines) of information |
-q |
Display the owner of the file |
-s |
Displays files in specific directory and all sub directories |
-t |
Controls which time field is displayed |
[time field] |
a last time accessed w last written |
-w |
Use wide list formatAssume the help page of the dir command looks like this.
DIR [-a[attributes]] [-b] [-o[[:]sortorder]] [-p] [-q] [-t[[:]timefield]] [-w] [path] [filename/dirname]
[path] [filename] |
Specify directory, and-or file to list |
-a |
Display files with specific attributes |
[attributes] |
d directories r read only files h hidden files |
-b |
Use bare format (no heading information) |
-o |
List by files in sorted order. |
[sortorder] |
n by name (alphabetic) s by size g group directories d by date-time (oldest first) |
-p |
Pause after each successful (24 lines) of information |
-q |
Display the owner of the file |
-s |
Displays files in specific directory and all sub directories |
-t |
Controls which time field is displayed |
[time field] |
a last time accessed w last written |
-w |
Use wide list format |
|