Articles

Open File

September 17, 2008 at 11:25:35
Specs: OpenVMS, AMD 1024

Hello,

I want to read a file with following DCL-Code:

OPEN/READ FILE <whatever>

How can i check if the file is open(lock) by an another user? Before I call the open/read code, I want to check if the file is open.

Thanks im behaviour.



See More: Open File

Report •


#1
September 18, 2008 at 06:55:20

Hello,

What are you trying to accomplish?

Is your goal is to avoid printing an error message from the OPEN command, one way is to use the /ERR qualifier to handle the error:

$OPEN/READ FILE <whatever> /ERR=SKIP_INPUT
$READ FILE etc
$CLOSE FILE
$SKIP_INPUT:
$EXIT

Kelly


Report •

#2
September 22, 2008 at 08:27:48

Thanks.;)

Report •

#3
November 23, 2010 at 03:50:41

If you have a file that is a set size and is constantly open, how can I tell its being used?

I have a db (flat file) that got itself into a infinite loop with a timing issue and wasn't writing the updates. I can't think of a way to determine if its being written too, as the size is constant and it doesn't open close on a regular intervals (changing file timestamp).

Much appreciated if anyone can point me in the right VMS direction, other than re coding the actual application.


Report •

Related Solutions


Ask Question