× 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.



I alluded to registering an exit point at the start of this thread but now recall that exit points are provided only for files configured to be scanned and fire when the scan opens and closes the file.
Anyway, listing the contents of a directory is such a trivial exercise without having to resort to any complex APIs that writing a monitor should be easy.

Peter

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of MARK GOLDEN
Sent: Friday, 14 February 2014 6:57 a.m.
To: Midrange Systems Technical Discussion
Subject: Re: Trigger on IFS Folder?

Hi,

Not to sure about this but I think I seen it recently.
I think you can use Exit Points to be triggered when changes occur in the IFS.


Use the net to search for IFS and WRKREGINF.

Hope this helps,

Regards,
Mark. 


________________________________
From: Roger Harman <roger_harman@xxxxxxxxxxx>
To: 'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxx>
Sent: Thursday, 13 February 2014, 17:42
Subject: RE: Trigger on IFS Folder?


*IF* you have control of the job stream, an option that I've used in the
past is to send a "sentinel" file after the data.  Your NEP can monitor for
the sentinel and then it knows the data transfer is complete.



-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry C. Adams
Sent: Thursday, February 13, 2014 6:11 AM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Trigger on IFS Folder?

Thanks, Scott and everyone.

I didn't think it was possible, but thought it was worth asking the pros.

I know what you mean about the NEP processing an open file, Scott.  I had a
program that read orders pushed from our retail stores.  Worked fine - until
my NEP kicked in while the store was downloading its details so I got half
of the order!  Not that it matters for this thread, but that was all in a
QSYS library.

Jerry C. Adams
IBM i Programmer/Analyst
If you hold a cat by the tail, you learn things you cannot learn any other
way. -Mark Twain
--
Home Office: 615-832-2730
email:  midrange@xxxxxxxx

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, February 12, 2014 4:35 PM
To: Midrange Systems Technical Discussion
Subject: Re: Trigger on IFS Folder?

No, not exactly.

What you can do is attach a journal to an IFS directory.  It's possible to
have an NEP that sits on the RCVJRNE API -- with the proper parameters, it
can cause your program to react immediately upon something happening to an
IFS file.

However, there are some caveats, too.  Often programs will open a file to
create it, then close it without writing any data, then open it again
later to write the data, then close it again...  so this makes it
really hard to detect when the program is actually done with the file.

Other times, programs will create the file under a different name, do their
thing, then rename it to the proper name when they're done.
Again, very hard to detect when they're done with the file.

I took my best shot at writing a program to handle it properly, it involved
delaying for a second or two after the file was created, then trying to get
exclusive use of the object (by using the open IFS API with O_SHARE_NONE).
This was mostly successful, but certainly can be
fooled...  If you'd like to check out my attempt, I put it into an
article with downloadable code, here:
http://iprodeveloper.com/rpg-programming/run-program-automatically-when-file
-uploaded-ifs

There's also a utility available from Easy400.net called MONIFS that I think
works similarly?  But haven't tried it, myself.. might be worth looking into
as well.


On 2/12/2014 4:18 PM, Jerry C. Adams wrote:
This is just a matter of curiosity.  I have applied triggers to
database files, but I was wondering if it was possible to apply a
trigger to a non-QSYS folder in the IFS?  That is, possible
application, which I'm thinking about, is if a file is dropped into
\FolderJA could I have a trigger program that would automatically be
invoked to process files in the folder?



In the past I just had a NEP that checked every, oh, 15-60 minutes to
see if there was anything there.



Thanks.



Jerry C. Adams

IBM i Programmer/Analyst

You are the result of 4 billion years of evolutionary success.  Act
like
it.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.



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.