Thanks, Razzak. That does the trick! I guess my enhancement request is somewhat redundant for those, like us, who have the PluginPowerPack.
Regards, Stephen Markson The Pharmacy Examining Board of Canada 416.979.2431 x251 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak Memon Sent: April-22-16 1:48 AM To: [email protected] Subject: Re: [RBASE-L] - test if a pdf file is in use At 10:35 AM 4/15/2016, Stephen Markson wrote: >Does anyone have a technique to determine if a pdf file is in use (i.e. >open in a pdf reader or editor)? > >I know that if the file is in use, OUTPUT filename.pdf causes an error >in R:Base. Therefore, this can be used to determine if the file is in >use. However, if the file exists and is not in use, OUTPUT filename.pdf >deletes the contents of the file. Is there a non-destructive way to >check? > >Thanks for any help with this. Stephen, Here's how ... SET VAR vResult TEXT = NULL PLUGIN GetFileLockStatus vResult|FileName.ext|CAN_READ_WRITE_EXCLUSIVE RETURN The resulting "vResult" variable will return the value of Yes, No, or File does not exist. So, in your case ... If you would like to check the exclusive status, use the command as follows: -- Simple Example PLUGIN GetFileLockStatus vResult + |D:\Documents\Customers.pdf + |CAN_READ_WRITE_EXCLUSIVE RETURN In a multi-user environment, if you have the exclusive rights to read and write, the vResult value will be "Yes", otherwise "No". Complete list of third parameter: CAN_READ - can read a shared file CAN_WRITE - can write to a shared file CAN_READ_WRITE - can read and write to a shared file CAN_READ_EXCLUSIVE - can read from a file and not allow anyone else to read CAN_WRITE_EXCLUSIVE - can write to a file and not allow anyone else to write CAN_READ_WRITE_EXCLUSIVE - have exclusive access to a file. Nothing is shared The result can be either of these: Yes|No|File does not exist. That's all there is to it! Very Best R:egards, Razzak. P.S. The GetFileLockStatus Plugin is a part of: . R:BASE PluginPowerPack 9.5, Build: 9.5.5.30422 or higher ... . R:BASE PluginPowerPack X (Version 10), Build: 10.0.1.20428 or higher ... -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

