Ability to read a file directory to get a list of file names

pfaloney

Well Known Member
We are currently looking at a possible upgrade to JDE and part of my analysis is to look at our interfaces and see if there is a way to improve the processing.

We have a series of Visual Basic 6 (yes VB6) programs that look at what has been placed in various drop zones on various servers and load the information for further processing (All standard Z-File processing).

My hope is to retire these programs since I am one the few that actually know any VB6. We also need to keep the drop zones and the associated file formats and names since the outside systems are not in scope for this upgrade.

I have not found a way to use a Report Object to read a directory and get a list of files for further upload processing within JDE.

Does anyone know a way to do this. We will be upgrading to 9.1 on a Windows system.
 
Short answer: Yes, you can do this with a C BSFN (may be other ways as well, but that is what I would/have used).
 
That would be an issue. No one really knows C (including myself) well enough internally to do this.
 
PF,

What's the OS?

Illogically, you could commit a system command that 'streams' the file-names into a text file. Then use flat-file operations to read through the streamed file?

http://technet.microsoft.com/en-us/library/bb490982.aspx

For example, on Windows, using command line:
DIR>DIRLIST.TXT

The ">" Sign says to redirect the output

Run the command in a windows box, then open the DIRLIST.TXT.

Now, if you were on a Windows Box, to get the Directory Listing, you would Execute External Command, then Read the Flat-file, parsing as necessary.

There are similar commands for all OS(s)...


Fish On!

(db)
 
There are good examples in B9600471 of using the FindFirst and FindNext windows functions for finding files in a directory. It is a client only function. You could switch to be client/server and start using it right away. Or you could make a copy of it. I have used the FindFirst and FindNext functions in custom BSFNs. It works great! Windows only, sorry to all the AS400 shops.
grin.gif
 
Great Catch - Scott!

Patrick,

The illogical suggestion 'can' work for your environment. Simple and silly - until you upgrade to a new version of windows and they change either the command, return/stream or output.

(db)
 
see,thats how I get out of all my work.I tell my clients "yeah,I could write that for you, but its only going to work until it doesn't, so why bother dude?" I'm all like: if its not going to last forever, then its a waste of my time. And we all know how valuable my time is. I know, right?




p.s. I used the windows directory functions when I needed this functionality, like 12 years ago, .... dude.
 
Those windows api calls will continue to work for the foreseeable future... otherwise there are going to be a lot of things that stop working outside of JDE.

I used the same calls in a couple of places and they have been in place for years.

_findfirst
_findnext
_findclose
 
We've implemented this functionality in 9.1 on the AS/400 platform using a custom bsfn that calls opendir and readdir_r apis.
 
Larry,

I am in the need of implementing a similar functionality for my client (requirement: to read a directory from JDE 9.1 on an AS400 box). I was considering writing a C BSFN myself rather than calling an external CL program on the AS400 server to accomplish the job.

Can you share with me the pseudo/actual code that you may have from your own implementation?

Many thanks in Advance.
- Shahid E
 
Hi Larry. Can you share the code with me? I'm in in need of reading the files from AS400
 
Back
Top