Is the program always writing to the same device? If so, you may want to make an entry in
/etc/fstab for the device such that it is mounted where you want it with the desired flags, etc. This will give your program a static location for which it can access the mounted filesystem.
Additional information about fstab
There are actually two mechanisms in our standard LXDE Linux image which can automount storage devices: udisks & an automount udev rule. udisks makes proper use of fstab; however, the udev rule appears to ignore fstab. Therefore, I recommend removing (or moving) the automount udev rule to ensure udisks handles automounting: