List filenames in a folder

Jimmy

New Member
Hi,

Suppose the following files exist:

c:\test\t1.csv
c:\test\t2.txt

Is there any function/statement in PROGRESS 8.3b that returns the filenames (t1.csv and t2.txt) in a given folder parameter (c:\test) ?

Thanks,

Jimmy
 

cup99

New Member
The code below should help.

DEFINE VARIABLE vFile AS CHARACTER EXTENT 3.
DEFINE STREAM strInput.

INPUT STREAM strInput FROM OS-DIR("c:\").

REPEAT:
IMPORT STREAM strInput vFile.
DISPLAY vFile[1] vFile[2] vFile[3 ].
END.


Each input has three elements: the file name, the file path and an attribute :

F — Regular file or FIFO pipe
D — Directory
S — Special device
M — Member of a PROLIB
X — Unknown file type
H — Hidden file
L — Symbolic link
P — Pipe file
 
U

Unregistered

Guest
def var temp as char init "C:~\test~\testfilename.csv".
disp substring(temp,r-index(temp,"~\") + 1,length(temp) -
r-index(temp,"~\")) format "x(30)"
 
Top