IsFileLocked

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > File >

IsFileLocked

available from build: 20060926

Description

This command allows to check if a file is currently locked because it's checkedout and opened.

Syntax

call DBWShell("IsFileLocked FilePathName")

Parameters

FilePathName

the full file path name

Return values

@IS_LOCKED

0: the file is not locked
1:the file is locked

Remarks

If the file is checkedin, it's not considered as locked even if opened;
if the file is checkedout, it's considered as locked only if opened.

IsFileLocked01 IsFileLocked02 IsFileLocked03

See also

IsFileLockedExclusive command

Example

sub main()

 filepath = DBWInput("@DOCUMENT_PATHNAME")
 DBWShell ("IsFileLocked " & replace((filepath)," ", "|"))
 isLocked = DBWResult("@IS_LOCKED")
 if isLocked = 1 then
  DBWMsgBox2 "the file is locked",16,"Check file lock"
 else
  DBWMsgBox2 "the file is not locked",64,"Check file lock"
 end if
end sub