|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > File > IsFileLocked |
available from build: 20060926
This command allows to check if a file is currently locked because it's checkedout and opened.
call DBWShell("IsFileLocked FilePathName")
FilePathName |
the full file path name |
@IS_LOCKED |
0: the file is not locked |
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.

IsFileLockedExclusive command
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