NOTICE: File System changes with Software Update

What: PolyScope update files (.urup) from 5.8 and above. e-Series only.
When: April 2020

Changes:
Software updates from PolyScope 5.8 and forward will change a larger portion of the file system than previous software updates.
This may have impact on URCaps that are storing data in a non-sanctioned way in the operating system.
When applying a new software update, sections of the file system will be cleared, and replaced with new updated sections.
This means, that if a URCap is storing files in these sections, they will be removed during a software update.
It should be noted, that URCaps in compliance with below policy for data storage should NOT be affected.

Policy for data storage:
URCaps should observe the following data storage policy:

  1. All relevant configuration data must be stored in the URCap’s DataModel object, respectively for ProgramNodes and InstallationNodes. The DataModel is stored within the robot program- and installation-files. All configuration done by the user must be stored here.
  2. The /programs/ directory may be used for storing special user-data, i.e. a configuration file retrieved from a camera, or other user relevant files that are of the interest for the user.
  3. If special files are required to be placed in the system OS, they are only permitted in the URCap’s bundle-folder in the Felix Cache. This can be retrieved from the OSGi BundleContext, by issuing BundleContext.getDataFile(). See OSGi references for more details.
    This includes special URCap log files and other special configuration data, that are not possible to store in the DataModel.
  4. The only exception to (1-3) is if a small (<1kB) hashed file is required to enforce licensing/license trials. In this scenario, the file can be placed in the /home/.urcapname/ directory.
2 Likes

Do you have any more information to step 3?

How do you place a file in the /home/.urcapname/directory? Can you test this in the Ubuntu environment?

The bundle folder is located in: /root/GUI/felix-cache/bundleXX/ on the physical robot.
In the simulator, this is within the “ursim” directory. Where XX is an arbitrary number of the specific OSGi bundle, i.e. “bundle99”.
This is “standard” OSGi functionality, and using the BundleContext provided in the Activator, you can get access to the bundle-folder of your URCap. Take a look at the OSGI BundleContext documentation of the BundleContext.getDataFile() which provides a File-object. This works both for physical robot and simulator.

If you are required to place a licensed file eg. /home/.mycompany/license.lic this can be done with regular java.io.File functionality.
Depending on the simulated setup (i.e. Ubuntu) the PolyScope user may not have access to write to that path. But this can be resolved in the OS itself (folder write permission). In the physical robot, PolyScope run as root, and can therefore create and write to this directory.

2 Likes

@jbm, the getDataFile(java.lang.String filename) returns a file object corresponding to the filename for which there is a file present in this folder. But how can you store a file in this folder? Is this also with regular java.io.File?
Also, will this file then be hidden when you go into the folder structure with FTP?
The reason for this is because I want to store an image somewhere unavailable to the end user. So the /programs/ folder is the last place to store it since it could then be found and removed using the Teach Pendant. However, I would assume that the directory /home/.urcapname/ would also be accessible when FTP is used or when the storage medium (SD or USB) is plugged into a laptop.
Is this correct?
If so, is there a way to store files of which the location can only be accessed by the URCap (and not by any other URCap)?
Thanks in advance.

I found a problem with that: when I have to upgrade the urcap, I have first to delete the previous version, and that wipes the directory (or the new urcap gets a different path).
Is there a path that I can use that won’t be wiped when I upgrade the urcap?

1 Like