|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > File > IsFileLockedExclusive |
available from build: 20150423
This command checks if a file is locked exclusively by another application (for example by Adobe Acrobat Reader when viewing a PDF file, or by Windows Explorer when previewing a PDF file).
call DBWShell("IsFileLockedExclusive FilePathName")
FilePathName |
the full file path name |
@IS_LOCKED_EXCLUSIVE |
0: the file is not locked |
If the file is selected in windows explorer and the preview is enabled (or the file is opened in a viewer), then it results locked:
while if the file is selecte in windows explores but the preview is not enabled (and the file is closed), the it results not locked:
IsFileLocked command
sub main()
filepath = DBWInput("@DOCUMENT_PATHNAME")
DBWShell ("IsFileLockedExclusive " & replace((filepath)," ", "|"))
isLocked = DBWResult("@IS_LOCKED_EXCLUSIVE")
if isLocked = 1 then
DBWMsgBox2 "the file is locked",16,"Check file lock exclusively"
else
DBWMsgBox2 "the file is not locked",64,"Check file lock exclusively"
end if
end sub