<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 18, 2016 at 5:31 AM, Sergio Schvezov <span dir="ltr"><<a href="mailto:sergio.schvezov@canonical.com" target="_blank">sergio.schvezov@canonical.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
>>> Why not SNAP_USER_DATA? As a user I cannot do anything on SNAP_DATA<br></span></blockquote><div><br></div><div>As predicted. :-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'd use PWD for everything to avoid confusions.<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Coincidentally though, the systemd units would make use of<br>
`WorkingDirectory=` to set it to SNAP_DATA for root run services and<br>
SNAP_USER_DATA for user ones (when those come).<br></blockquote><div><br></div><div>Yes, that indeed feels like a better approach, and an expected one since it's exactly how processes have always worked in Linux.</div><div><br></div><div>Another reason to do it is that it opens the door for us to handle command lines in a more standard way in terms of relative paths, when security constraints permit.</div><div><br></div><div>The consequence, though, is that processes cannot assume they are inside their data directory, because they might well not be. But I think that's alright.. per my initial point in this thread - it's usual for applications to pick their preferred working space and move there, when they don't want to work on the local relative path context.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The binaries one is quite tricky because I'll try to access a file and<br>
all of the sudden I'll get "No such File or directory" style errors.<br>
<br>
<br>
    $ cd ~<br>
    # in theory this would be just `vim` in the future.<br>
    $ vim.editor Documents/myfile<br></blockquote><div><br></div><div><br></div><div>In practice, actually. We already agreed that when <snap name> == <app name>, the executable name becomes just <snap/app name> rather than <snap name>.<app name>.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I still prefer SNAP_USER_DATA though.<br></blockquote><div><br></div><div>If we change to that, tomorrow someone will come along and report a bug about it not being $SNAP_DATA again. :-)</div></div><br clear="all"><div><br></div><div>gustavo @ <a href="http://niemeyer.net" target="_blank">http://niemeyer.net</a></div>
</div></div>