folders and documents

40 pts.
Tags:
Application development
AS/400
CLP
RPGLE
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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)

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Qbjgqbjg
    This is an I-series program. The folder is on the I drive.
    40 pointsBadges:
    report
  • WaltZ400
    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.
    655 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following