|
Carel, you were first, and there is source code to boot, so I will start there, in the archives. Thanks! John, thanks. same solution as Carel Al, it looks like CHKIFSE needs to know the name of the file, plus isn't TAATOOLS a pay-for product now? rather roll my own. but thanks for the sugg. Phil, thanks for the sugg, but I'll steer clear of unix shell stuff. bad enough using c functions, if I started coding unix and socket stuff, the client would REALLY freak out. Rob, GOOD POINT! the file will not be remarkably large, and will be copied locally (created by a peoplesoft application) - so the time frame involved will be short between the begin and end of the copy... maybe after discovering the existance of the file, wait 30 seconds (way more time than it should take to finish copying) before processing. is there a way to check for a lock on an ifs file? thanks to all who answered! Other than the file lock, I think I've got enought to go on. once again, the list pays for itself... :) Rick ----original message with replies------- Hey all, I'm looking for a way to have an NEP batch job periodically (say, every 5 min or so) monitor for the existence of a file (any file, any name) in a specific folder on the IFS. what I want to do is to monitor for a situation - a user moves/copies a file into a folder on the ifs - and have that action start a process where the as/400 uploads the file, deletes it off the ifs and processes the file. most if this stuff is pretty basic, but the piece i'm clueless about is how an rpg program (or clp, or whatever) can go looking for files in the IFS, without knowing the name. The file could be named anything, but then I will need to determine that name so I can upload it to the 400 (via cpyfrmimpf). any ideas? thanks, Rick ----------------------- From: "Carel Teijgeler" <coteijgeler@chello.nl> Hello Richard, Search the archives for opendir() API. In one of the result you get the source of a utility, DIR, that lists the contents of a directory on the IFS, output to screen, print or file. Perhaps that may be sefull. Regards. Carel Teijgeler ----------------------- From: jpcarr@tredegar.com Rick, Simple Subsystem Prestart Job, CLLE waits xxx seconds, Calls RPGIV program, It does a opendir on a directory name, then does a readdir on the directory, Calls Stat for each of the files, Looks at the creation/modified date, If it's new, Call program to CPY it to where you want it. If you want sample of RPGIV opendir, readdir, stat send me a private email. I wrote a IFS logging utility for my shop that takes a snapshot each month of the Whole IFS and tracks trends by directory. (sizes, owners, etc.) Snapshot could be run anytime to diagnose problems like "Where'd the heck did the disk space go over night?" John Carr ----------------------- From: "Al Barsa/Barsa Consulting" <barsa@barsaconsulting.com> Hi, The CHKIFSE command in TAA Tools will do what you're looking for. http://www.taatool.com/document/L_chkifse.htm Al ----------------------- From: "Hall, Philip" <phall@spss.com> You should be able to do the same thing that the Unix (and QShell cmd ) 'tail' does. Open a file descriptor to the directory and then use select() (I know, it's not a socket, but select() works on descriptors) and you'll drop off the select() when any additions, deletions, changes, etc occur at that directory level. At that point you can use opendir and iterate over the directory to see what's changed. I have example code of IFS directory iteration (recursively) in RPG here; http://www.midrange.com/imho/phil/200010.shtml --phil ----------------------- From: rob@dekko.com Wouldn't you also have to check to see if there is a lock on that object? Example: Customer ftp's a quasiedi file to you. Your program checks for it's existence. It's there so it processes it. Hark! They are still sending it! Egads! What happens? Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
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.