HTML File is getting locked by bat file call or Tomcat
Akshay D Joshi
posted 4 years ago
I am calling a bat file in java In bat file i am appending multiple html files to one Final html file
---Bat file code --
IF EXIST consolidatedHTML.html (
del consolidatedHTML.html --- > if user creats html for the second time then i delete existing file and create new
call type %2\file 1.html >> %1\consolidatedHTML.html
call type %2\file 2.html >> %1\consolidatedHTML.html
call type %2\file 3.html >> %1\consolidatedHTML.html
--end Bat file code
After this Final html is generated i convert this file to pdf using htmltopdf converter in java..
when i convert this file to pdf the request is sent to server ,but it is not executed.
So i came to know that the Final html is locked .
When i try to delete file manually ,
windows alert comes : file is being used by another person or program.
when i shotdown tomcat and delete the file manually,it gets deleted.
So which process is holding my file Tomcat process or Batch file process ?....
Also the main thing is that multiple users access the batch file and htmltopdf code .
What is the solution for this ?
One is to write java code for appending html files..so i can,but need to know the reason for the above issue.