I am working on automation of a business process that looks like this. Through the web interface (php) user enters few parameters about product, and then I need to generate few files in different format. This is metal fabrication business and plasma cutting machine needs .dxf file. I have installed CAD program that I want to feed with AutoCAD (.scr) script generated during the web phase. This works from the command line: `s:\bcad\icad.exe /b s:\scripts\my.scr` which tells the OS to execute icad.exe and start executing my.scr. In my.scr there are instructions for drawing the shape, exporting to .dxf, saving to native format .dwg, printing to .pdf and finally exiting/closing icad.exe. Then I need to move these files to a different locations.
I was thinking to make it as a perl script which will scan the directory where web script drops the my.scr constantly or every few minutes and execute above command, then finally delete the my.scr.
My web script is in php and I tried exec(), but process starts in the background, sitting there and my web page hangs.
I would appreciate if someone can show me few lines of code or point me to an existing similar solution to this problem
Thanks,
Shreko