Hi Stuart,
We execute this test on the record ID in the &HOLD& and _HOLD_ files,
Q-pointed to the ANPHOLD file in our Pick print spooler on Universe and
Unidata.
When it is running on a .nix O.S., we use the fuser executable in our
SPOOLING phantom:
CMD = \SH -c'fuser "ANPHOLD/\:ID:\"'\
EXECUTE CMD CAPTURING ANS
PID = FIELD(ANS<1>,':',2)
PID = TRIM(PID)
IF PID # '' THEN GOTO 15 ; * The record is still open, so go on
to the next record without processing this record.
When it is running on a .doz O.S., we originally used the .doz handle
executable from sysinternals.
We found, however, that the *optional* "errlog" file in the UV directory on
Universe received an entry each time handle.exe failed (ie the file was
still open) and that caused the end-user some errlog file
maintenanceproblems if the errlog file had been created.
Otherwise, handle.exe works just fine.
Now, we use a little DELPHI program, opener.exe, that attempts to open a
file in read/write mode.
If it succeeds, it prints 'file <filename> opened [1]'
If it fails, it prints 'Cannot open file <filename> [0]'
You can capture these responses and test for 0 or 1.
I'll be glad to send you directly the code for opener.exe and the calling
program, CHECK.OPEN.FILE, that we call from our SPOOLING phantom if you'd
like.
hth,
Dave
Dave Taylor
Sysmark Information Systems, Inc.
Authorized IBM Business Partner
49 Aspen Way
Rolling Hills Estates, CA 90274
(O) 800-SYSMARK (800-797-6275)
(F) 310-377-3550
(C) 310-561-5200
www.sysmarkinfo.com
----- Original Message -----
From: "Boydell, Stuart" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 02, 2008 8:07 PM
Subject: [U2] [UV] Checking file mode for type 19 item
I need to check the write status of an item in a type 19 file. Normally,
it will bomb out on write while trying to update a read-only item. (on
error and else clauses don't seem to do much for this in a write
statement).
I have a 'before update' trigger checks if an item in a type 19 file is
writable. The only mechanism I can see is to use an 'openseq' on the
item and find 'status<5>' for it.
This works but it still seems a clumsy long way around. Does anyone know
a more efficient way to do this?
Cheers,
Stuart Boydell
Senior Analyst
Information Services
Spotless
T +61 3 9269 7398
M +61 4 1115 0246
[EMAIL PROTECTED]
www.spotless.com
**********************************************************************
This email message and any files transmitted with it are confidential and
intended solely for the use of addressed recipient(s). If you have
received
this communication in error, please reply to this e-mail to notify the
sender
of its incorrect delivery and then delete it and your reply. It is your
responsibility to check this email and any attachments for viruses and
defects
before opening or sending them on. Spotless collects information about you
to
provide and market our services. For information about use, disclosure and
access, see our privacy policy at http://www.spotless.com.au
Please consider our environment before printing this email.
**********************************************************************
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/