|
Tom, There's a QShell command to do this called ls. Passing the -R flag to it will make it recurse all of the sub directories below the starting path. An example would be: ls -R /home (if you wanted to get the size and other attributes, you'd use ls-Rla /home). If you need to process the output, you could pipe it to a file and then read it back in but the format of the output doesn't work to well for that. If you need to do something with the files or write a report that's better looking than ls's output, there's a process directory tree API. I forget the name of it but there's an example in the RedBook "Who Knew You Could Do That In RPGIV?". The example does basically what ls does but you could easily make it do something else (I changed it to write a list of files to a physical file which I then read through in another program). There are other API's you'll need if you want additional information about the files (owner, creation time, permissions, etc...). There may be some other commands for getting a listing in the IFS Tools I mentioned earlier. Matt -----Original Message----- From: Tom [mailto:tomh@xxxxxxxxx] Sent: Thursday, September 04, 2003 3:57 PM To: rpg400-l@xxxxxxxxxxxx Subject: How do I list IFS subdirectories? Say that I have the following IFS directory structure: /PHIL/028cs /PHIL/028cs/s1 /PHIL/028cs/s2 /PHIL/028cs/s2/ss2-1/ss2-1-1/file.txt /PHIL/028cs/s3/ss3-1 Is there a command which will list all of the directory paths? Thanks! _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.