ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Read through file names - IFS

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read through file names - IFS

    I need to write a bit of code that reads the file names (not the actual file itself) from an IFS directory, so I can store this in a DBF.

    How do I go about doing this? Can anyone show me any examples?

    Thanks,

  • #2
    IMHO the easiest way is, to generate files with the RTVDIRINF Command and the read the information you need from the outfile(s).
    Code:
    RTVDIRINF DIR('/yourDir/Dir2')    
                   INFFILEPFX(YOURS)       
                   INFLIB(YOURLIB)
    An other way would be to use the qshell command find and direct the result to a table.

    Birgitta

    Comment


    • code401
      code401 commented
      Editing a comment
      Thanks for your reply. I have discovered the command: LISTDIRS, which places the results into a table.

  • #3
    It somewhat depends on just what you need to process. Directories can contain other directories - do you need to drill down into them?

    I wrote a series of articles back in 2005 that went through the whole process and introduced a generic routine that could easily be used in Service Program. As is often the case these are currently "missing" from the magazines web site but I can supply you with pdfs of the base articles. Just message me if you want them.

    Comment

    Working...
    X