Checking for Read Only - Is the file already open?

Checking for Read Only - Is the file already open?

Anonymous
Not applicable
276 Views
3 Replies
Message 1 of 4

Checking for Read Only - Is the file already open?

Anonymous
Not applicable
You can check the attributes of a file using the getattr function. But what
if the file does not have any attributes set, and is open by another user?
The getattr function will not return 'read only' because that attribute has
not been set.

How do you check to see if the file is open by another user?

Thx.

Rob Webb
0 Likes
277 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
If you are using A2ki, the following will work.

Application.Documents.Open YOURDRAWINGPATH
If ThisDrawing.ReadOnly Then
MsgBox "Drawing opened in read-only mode."
End If

I'd imagine this would work in A2k also.

Good luck.

Chuck

"Rob Webb" wrote in message
news:C92A1D747363E903B151E9F4ABCB5E27@in.WebX.maYIadrTaRb...
> You can check the attributes of a file using the getattr function. But
what
> if the file does not have any attributes set, and is open by another user?
> The getattr function will not return 'read only' because that attribute
has
> not been set.
>
> How do you check to see if the file is open by another user?
>
> Thx.
>
> Rob Webb
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thx Chuck:

I am using A2Ki. This method will be sufficient for what I am doing.
But, if you use this method, the drawing file is opened before you can check
for read only. Is there a way to check for read only before the file is
opened?

Rob

"Chuck Gabriel" wrote in message
news:FA43E82929832E1D61232CFD0E218A0C@in.WebX.maYIadrTaRb...
> If you are using A2ki, the following will work.
>
> Application.Documents.Open YOURDRAWINGPATH
> If ThisDrawing.ReadOnly Then
> MsgBox "Drawing opened in read-only mode."
> End If
>
> I'd imagine this would work in A2k also.
>
> Good luck.
>
> Chuck
>
> "Rob Webb" wrote in message
> news:C92A1D747363E903B151E9F4ABCB5E27@in.WebX.maYIadrTaRb...
> > You can check the attributes of a file using the getattr function. But
> what
> > if the file does not have any attributes set, and is open by another
user?
> > The getattr function will not return 'read only' because that attribute
> has
> > not been set.
> >
> > How do you check to see if the file is open by another user?
> >
> > Thx.
> >
> > Rob Webb
> >
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
Worth considering lock files. The you need to just check if the .dwk file
exists.
0 Likes