Hi. I have a bunch of read-only resource files that need to be accessible from within python on the client-side.
How can I distribute these files to the clients and where would they be stored? I would like to avoid the use of Windows SMB shares if possible- ideally it would be distributed with the rest of the Java code.
Thanks.
Simon
What about using a web server like IIS or Apache to dish out the files?
I had considered that, but it would require setting something up in python to retrieve and cache the files. I was hoping there was some way I could use Ignition to distribute them.
If you put the files on the Ignition server under:
C:\Program Files\Inductive Automation\Ignition\tomcat\webapps\main
than we will serve it up through the following url:
ipaddress:8088/main/file.ext
If you don’t want to go down that route you can make a module in Ignition that exposes a scripting function the client can use.
Were you thinking on embedding the resources into the client?
Yes. I was thinking it might be possible to embed the resources into the jar file or similar. The caveat is that I would imagine they would need unpacking before they can be sanely accessed by the python script code.
[quote]If you put the files on the Ignition server under:
C:\Program Files\Inductive Automation\Ignition\tomcat\webapps\main
than we will serve it up through the following url:
ipaddress:8088/main/file.ext
If you don’t want to go down that route you can make a module in Ignition that exposes a scripting function the client can use.[/quote]
Wow… that’s awesome. I’ll definitely put that to good use. Good tip!
If I write a module to do this, where should I save the files on the client side?
I’m currently thinking of just using ‘$HOME/.ignition/files/’. Another possibility is the system TEMP directory.
Any thoughts?
If you don’t need the files permanently than I would put them in a temp directory. You can create your own directory in the user’s user directory. I wouldn’t put the files in the .ignition folder since that is our cache.