Returns a string array of file names.
fspec (string) – file specification to search for. Can include path and wildcards.
fnames (Nx1 string array) – all file names that match or null string if none are found.
Example 1: List all example files¶
Print out the list of all files located in the GAUSS examples directory which end with the file extension
fspec = getGAUSSHome() $+ "examples/*.e"; print filesa(fspec);
Example 2: Find which start with specific letters¶
This example will search the current working directory for any file which starts with
fnames = filesa("ch*");
Example 3: Create proc to check if a file exists¶
proc exist(filename); retp(not filesa(filename) $== ""); endp;
This procedure will return 1 if the file exists or 0 if not.
fnames will contain file names only; any path information that was passed is dropped.