40 pts.
 folders and documents
Is there a way for a program to find out if a folder contains any documents (we will not know a document name). We need to know if the folder is empty or if it contains any documents.

Software/Hardware used:
ASKED: June 27, 2006  4:30 PM
UPDATED: December 10, 2009  8:37 AM

Answer Wiki:
Unix: Use popen to execute an ls command, and see if there's any output. Windows: There are interator functions that do the same thing. You call the first one to set the list of files you want, and call an iterator routine to get the next one. If you get none, no files. AS/400: There are system tables that give you this. I'm not in front of the 400 right now, but I think the table name is sys_tables. One of the fields gives the library (schema) name. Check the number of such records. --- Sheldon Linker (sol@linker.com) Linker Systems, Inc. (www.linkersystems.com) 800-315-1174 (+1-949-552-1904)
Last Wiki Answer Submitted:  June 27, 2006  5:50 pm  by  SheldonLinker   15 pts.
All Answer Wiki Contributors:  SheldonLinker   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

This is an I-series program. The folder is on the I drive.

 40 pts.

 

On the iSeries there is a command called QRYDOCLIB. It will create on output file listing all documents in folders based on your search criteria. You can search all folders or a specific folder as well as specificying whether subfolders are included or not. Other criteria lets you find documents by who created the document, last maintained date, etc.

 645 pts.

 

Folders and documents? Or directories and files? They’re not exactly the same.

QRYDOCLIB, for example, can work for “folders and documents” but not for directories and streamfiles outside of the /QDLS file system.

Tom

 108,280 pts.