advanced directory listing ...

Prev Next

Function Names

advanced directory listing, advanced directory listing recursive

Description

This function works very similarly as directory listing() and directory listing recursive(). The only difference to them is that all identified Microsoft office document properties from open office Word, Excel, Powerpoint and Visio files wll also be added as additional columns to the directory listing.

Attention: Encrypted, binary and proprietary legacy file types (e.g. .xlsb, .xls, .doc, .ppt) cannot be processed.

Call as: procedure or function

Restrictions

Indirect parameter passing is disabled

Parameter count

1-4

Parameters

No.TypeDescription
1
input
string name of destination table

The directory listing will be put into this table, with header names as lsited above. If the table is not yet existing, then it will be created. Existing tables will be initialized first.

Opt. 2
input
string drive or path name

Specify a disk drive (e.g. C:\) or a path name (/usr/local, or \\server_name\path_name\...). If no additional parameters are provided, then the path name may also contain a file name (to list 1 file) or matching pattern to list specific files.
Note: Wildcard symbols are supported here for the file name, but not for the path name (OK: C:\Subdir\*.txt, Not OK: C:\Sub*\*.txt)

Default value: Current working directory
Opt. 3
input
string pattern name

Specify a disk drive (e.g. C:\) or a path name (/usr/local, or \\server_name\path_name\...). If no additional parameters are provided, then the path name may also contain a file name (to list 1 file) or matching pattern to list specific files.
Note: Wildcard symbols are supported here for the file name, but not for the path name (OK: C:\Subdir\*.txt, Not OK: C:\Sub*\*.txt)

Default value: * (all files)
Opt. 4
input
string search option

One of the following:

files Files only
directories Directories only
files and directories Foth files and directoreies (default)
all Also includes hidden and system files

Default value: files and directories

Return value

TypeDescription
numeral Entry count

Total number of files and/or directories found. -1 = Error (e.g. invalid path). Table will be empty in this case.

Examples


               rv[] = advanced directory listing( list, "Examples/", "*.xlsx,*.xls" );
               table delete remaining rows(list, 4 );
               // Just keep the first 3 rows to fit the output on the screen

               table transpose( list ); // Make the list fit on the small output
               table list( list );

Output

    0 : Path           | Examples\           | Examples\                     | Examples\           
    1 : Name           | Cities.xlsx         | Football Membership List.xlsx | Formulas_Inside.xlsx
    2 : Date Created   | 2024-02-11          | 2024-02-11                    | 2024-02-11          
    3 : Time Created   | 14:28:59            | 14:28:59                      | 14:28:59            
    4 : Date Updated   | 2024-10-19          | 2021-05-26                    | 2021-03-13          
    5 : Time Updated   | 21:48:50            | 23:13:25                      | 15:29:04            
    6 : Directory      | No                  | No                            | No                  
    7 : System         | No                  | No                            | No                  
    8 : Hidden         | No                  | No                            | No                  
    9 : Archive        | Yes                 | Yes                           | Yes                 
   10 : Read Only      | No                  | No                            | No                  
   11 : Size           | 9195                | 12581                         | 13463               
   12 : creator        | B4P zur-b           | Zur Bonsen Georg              | Zur Bonsen Georg    
   13 : lastmodifiedby | B4P zur-b           | Zur Bonsen Georg              | Zur Bonsen Georg    
   14 : created        | 2024-10-19 19:48:50 | 2020-07-08 19:27:50           | 2021-03-13 13:54:16
   15 : modified       | 2024-10-19 19:48:50 | 2021-01-03 21:17:40           | 2021-03-13 14:29:03

Try it yourself: Open LIB_Function_advanced_directory_listing.b4p in B4P_Examples.zip. Decompress before use.

See also

directory listing
directory listing recursive