B4J Question Use of a pdf file check

strupp01

Active Member
Licensed User
Longtime User
In my program I create a pdf file, which is displayed and then can be printed. If a further pdf file with the same name is generated, the program crashes, since this filename as pdf is opened.
Is there a command that verifies that the file is already in use? Or can one query the pdf reader is active?
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
The file.delete function return true if it was capable to delete the file.

Try to delete the file and if you couldn't that means that the file is in use.

Other one is to simply read all files within the folder and check if the name exists and add a consecutive number.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…