Operating System - OpenVMS
1830387 Members
2682 Online
110001 Solutions
New Discussion

Directory Change Notification - ODS-2/ODS-5

 
SOLVED
Go to solution
Antoniov.
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Oshadi,
it's not elegant but works!
Don't forget, writer application has to open with /SHARE=READ qualifier.

Antonio Vigliotti
Antonio Maria Vigliotti
Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

About the locking ...

It is better to create the file with extention .NEW and when it is completely created to rename it to the .LIS or whatever extention. This way you won't see files being created during f$search.

About signaling ...

What if the signal didn't arrive (e.g. cluster transition and tcp timeout when tcp is used for signaling) ? Make sure that at startup, you start processing the files before you get the signal.

Wim
Wim
Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

And hope you don't use high water marking mixed with big file creations.
http://forums2.itrc.hp.com/service/forums/questionanswer.do?threadId=603651

Wim
Wim

Re: Directory Change Notification - ODS-2/ODS-5

brrr... yes, we have HWM; big file creations are infrequent, though...
hey ho, what do you know...
Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Also remember that f$sea with a context variable must be used until the "" is returned. Otherwise a cancel must be done.

If not, you will run out of process dynamic memory (show proc/mem). I've been there ...

Wim
Wim

Re: Directory Change Notification - ODS-2/ODS-5

> Otherwise a cancel must be done.

How would I do that?

The report writer creates files with the date and time in the file name; plus I fill in all the common parts of the filename in my call to f$search(); so 99.99% of the time, it should return "" on the second call...
hey ho, what do you know...
Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

OEPS ... zero for me.

It's f$context that needs to be cancelled as in :

$ ct=""
$ y=f$con("process",ct,"prcnam","''P1'","eql")
$ pid==f$pid(ct)
$ if pid .nes. "" then y=f$con("process",ct,"cancel")

Sorry for the confusion

Wim
Wim
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

I use:
$ F = F$SEARCH ("@", stream_id)
.
Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

I'm getting old.

As Uwe wrote, if you leave a f$sea("xxx", streamid) then you have to reset it or otherwise your next loop will continue in the old context.

Wim
Wim
Antoniov.
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

I use stream_id like Uwe.

Antonio Vigliotti
Antonio Maria Vigliotti
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Hm, then I might have misread "context variable ", Wim. The stream-id is only required if you have multiple, concurrent F$SEARCH operations that must not interfere. For single streams I use, obviously: F$SEARCH ("@")
.
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Ah, forgot: and I always put in a comment that this invalidates the current search context.

If you like to confuse somebody, use this:
$ F = F$SEARCH (F$TIME())
.

Re: Directory Change Notification - ODS-2/ODS-5

or
$ F = F$SEARCH(F$UNIQUE())

:D

especially for VAX users...
hey ho, what do you know...
Wim Van den Wyngaert
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

It is not documented how f$sea must react when an invalid file specification is given as in "@". It could be "reset" or it could be "ignore because invalid" or it could be "fatal error". Uwe is lucky that it is "reset". Safest seems to me "aaaaaaaaa.bbbbb" or something else that is likely impossible.

There should have been a "cancel" function but there isn't.

Wim
Wim
Jan van den Ende
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5


or
$ F = F$SEARCH(F$UNIQUE())

:D

especially for VAX users...


... remember f$unique is a REAL new functionality.
Only available in patched V7.3-2 & V8.2

.. not sure about Vax/VMS

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Jan van den Ende
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Re Uwe:

I reset f$search context by a call to
f$search("reset_context")

Pretty much ensures that anyone will be able to decode that!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Yes, good ideas. I've once discovered this in my VAX/VMS V4 days and stuck with it. (old/bad habits never die ;-)
.
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Yes, that's what I wrote this morning ;-)
.
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Hey, Antonio, why did you get that dropped?
Now it looks like I am a fool :-(
.
Antoniov.
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Uwe,
I opened two session and I mistaked with mouse. Wrong post was dropped by HP moderator. You can do the same.

Antonio Vigliotti
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

reading thread it looks like a dialog between fools.
I posted a no sense message and I request to HP moderator to drop.
Uwe is a quick man and posted his notice.

Uwe you are too many fast ;-)

Antonio Vigliotti
Antonio Maria Vigliotti
Uwe Zessin
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Let's keep it here so that our friends have some fun, too ;-)

And don't spill any coffee, coke, ... on your keyboard!
.
Antoniov.
Honored Contributor

Re: Directory Change Notification - ODS-2/ODS-5

Spilt a beer :-)

Antonio Vigliotti
Antonio Maria Vigliotti

Re: Directory Change Notification - ODS-2/ODS-5

Here's a big thanks to everyone... All the responses helped me develop a working solution, and I learned a lot as well.

Thank you!
hey ho, what do you know...