× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here is the source code.  Prototypes to follow!

         ctl-opt dftactgrp(*no) actgrp(*new);

         dcl-s wImportDir varchar(64) inz('/import/inbound/');
         dcl-s wReceivedDir varchar(64) inz('/import/received/');
         dcl-s wErrorDir varchar(64) inz('/import/error/');
         dcl-s wFileName varchar(128);

         dcl-s hDir pointer;
         dcl-ds dsDirEnt likeds(IFS_DirEnt) based(pDirEnt);
         dcl-ds dsStat likeds(IFS_Status);

         // Open directory, exit on error
         hDir = IFS_opendir(wImportDir);
         if hDir = *null;
           log( 'opendir': errno);
           return;
         endif;

         // Spin through folder
         dou (pDirEnt = *null);

           // Get next directory entry, exit on null
           pDirEnt = IFS_readdir(hDir);
           if pDirEnt = *null;
             leave;
           endif;

           // Skip subdirectories
           wFileName = %trim(%str(%addr(dsDirEnt.name)));
           IFS_stat(wImportDir + wFileName: %addr(dsStat));
           if %bitand( dsStat.mode: C_MODE_DIRMASK) = C_MODE_DIRVAL;
             iter;
           endif;

           // Route the file to the appropriate application
           Route( wErrCd: wImportDir: wFileName);
           if wErrCd = *blanks;
             MoveIFS( wImportDir: wFileName: wReceivedDir);
           else;
             MoveIFS( wImportDir: wFileName: wErrorDir);
           endif;

         enddo;

         IFS_closedir(hDir);

         *inlr = *on;
         return;


On 5/14/2019 11:21 AM, Jeff Bianchi wrote:
I just finished reading this article by Joe Pluta: https://www.mcpressonline.com/programming/rpg/practical-rpg-processing-an-ifs-directory

At the bottom are two links: 1. Source code, and; 2. Prototypes and DS

Those links are broken. Does anyone have the source for these two, or a working example based on this article?

Thanks!



Jeff Bianchi

Jeff.Bianchi@xxxxxxxx<mailto:Jeff.Bianchi@xxxxxxxx>| P 253.804.1034
Oak Harbor Freight Lines, Inc.
"Bringing Peace of Mind Since 1916."



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.