<div dir="ltr">Hi Jenny,<div><br></div><div>I do not think you need to define "<span style="font-size:12.8px">SNAP_USER_DATA".</span>It is already there. Please check my "hello" example code at <a href="https://github.com/liu-xiao-guo/helloworld-demo">https://github.com/liu-xiao-guo/helloworld-demo</a>. After you install the app, you can run the command like:</div><div><br></div><div><div>liuxg@liuxg:~$ hello.env | grep SNAP</div><div>SNAP_USER_COMMON=/home/liuxg/snap/hello/common</div><div>SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:</div><div>SNAP_COMMON=/var/snap/hello/common</div><div>SNAP_USER_DATA=/home/liuxg/snap/hello/x1</div><div>SNAP_DATA=/var/snap/hello/x1</div><div>SNAP_REVISION=x1</div><div>SNAP_NAME=hello</div><div>SNAP_ARCH=amd64</div><div>SNAP_VERSION=1.0</div><div>SNAP=/snap/hello/x1</div></div><div><br></div><div class="gmail_extra">Basically, SNAP_USER_DATA is defined as "/home/liuxg/snap/Your_Package_Name/version_number"</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra">XiaoGuo</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 25, 2016 at 7:03 PM, Jenny Murphy <span dir="ltr"><<a href="mailto:jenny.murphy@episensor.com" target="_blank">jenny.murphy@episensor.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi,<div> Do I need to define the location of <span style="font-size:12.8px">SNAP_USER_DATA. Currently I added the following line to a wrapper script that already runs in my app :</span></div><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">echo "User Data = " $SNAP_USER_DATA</span></div><div style="font-size:12.8px"><br></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">The result is</div><div style="font-size:12.8px"> User Data =</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks a lot for you help. I guess this stuff is very basic but I am having to get up to speed quickly on snappy.</div><div style="font-size:12.8px">Jenny </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 August 2016 at 12:01, Zygmunt Krynicki <span dir="ltr"><<a href="mailto:zygmunt.krynicki@canonical.com" target="_blank">zygmunt.krynicki@canonical.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>Wiadomość napisana przez Jenny Murphy <<a href="mailto:jenny.murphy@episensor.com" target="_blank">jenny.murphy@episensor.com</a>> w dniu 24.08.2016, o godz. 12:58:</div><span><br><div><div dir="ltr">Hi,<div> I have a java application built as a .snap.</div><div>As part of its normal operation it will create some files (for output).</div><div>However this is not successful due to permissions issue :</div><div>For example , I tried to create the file in /home/ubuntu/examples/ :</div><div>java.io.FileNotFoundException: /home/ubuntu/examples/example.<wbr>txt (Permission denied)</div><div>I got a similar result whenI tired to create it in the current dir :</div><div>/apps/gateway.sideload/IcNYWMF<wbr>DGBeY<br></div></div></div></span></blockquote><div><br></div>You can freely create files in $SNAP_USER_DATA - the per-user data directory or $SNAP_DATA - the global data directory (for daemons).</div><div><br></div><div>If you want to write to other locations you need an interface to do it. For example you can use the home interface to get write access to most of the $HOME directory.</div><div><br></div><div>You can do this by just defining a „home” plug on your application.</div><div><br></div><div>Best regards</div><div>ZK</div><div><blockquote type="cite"><div><span><div dir="ltr"><div><br></div><div>So is there a way around this?</div><div><br></div><div>Thanks in advance for any suggestions.</div><div><br></div><div>-- <br><div data-smartmail="gmail_signature"><div><strong>Jenny Murphy</strong></div>
<div><strong>EpiSensor, Georges Quay House, Georges Quay, Limerick, Ireland</strong></div>
<div>jenny.murphy<a href="mailto:jenny.murphy@episensor.com" target="_blank">@episensor.com</a> t | <a href="tel:%2B353%20%280%29%2061%20512%20511" value="+35361512511" target="_blank">+353 (0) 61 512 511</a> w | <a href="http://www.episensor.com/" target="_blank">http://www.episensor.com</a></div></div><span class=""><font color="#888888">
</font></span></div></div></span><span class=""><font color="#888888"><span><font color="#888888">
-- <br>Snapcraft mailing list<br><a href="mailto:Snapcraft@lists.snapcraft.io" target="_blank">Snapcraft@lists.snapcraft.io</a><br>Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" target="_blank">https://lists.ubuntu.com/mailm<wbr>an/listinfo/snapcraft</a><br></font></span></font></span></div></blockquote></div><span class=""><font color="#888888"><br></font></span></div></blockquote></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div><strong>Jenny Murphy</strong></div>
<div><strong>EpiSensor, Georges Quay House, Georges Quay, Limerick, Ireland</strong></div>
<div>jenny.murphy<a href="mailto:jenny.murphy@episensor.com" target="_blank">@episensor.com</a> t | <a href="tel:%2B353%20%280%29%2061%20512%20511" value="+35361512511" target="_blank">+353 (0) 61 512 511</a> w | <a href="http://www.episensor.com/" target="_blank">http://www.episensor.com</a></div></div>
</font></span></div>
<br>--<br>
Snapcraft mailing list<br>
<a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">XiaoGuo, Liu (刘晓国)<div>Mobile: +86-13911181302</div></div></div>
</div></div>