<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 21, 2019 at 8:48 PM Winnie Poon <<a href="mailto:winniepoon_home@hotmail.com">winniepoon_home@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I'm trying to access a file in say /home/user/hello.txt, which is normally not accessible from sandbox without doing (--file-system=/home/user), so i want to access this file via the portal (without the --file-system permission), get the content.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I thought for the portal test example, the file chooser open together with the "Save as ..." button will do that but apparently the "Save as..." only create a new file with a hardcoded "test" content.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
e.g. there's a file /home/user/hello.txt</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
if I open up the --filesystem=/home/user, then i can do g_file_get_contents("/home/user/hello.txt, ...." to see the file, but without the ---filesystem=/home/user, hello.txt cannot be seen.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
My understanding is the gtk_file_chooser API will communicate iwth the dbus API to open up permission to hello.txt? but i'm having trouble getting the code to do that.</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Sorry i'm a bit confused <span id="gmail-m_7643477925574976124🙁">🙁</span><br>
</div><br></div></blockquote><div><br></div><div>This all seems perfectly correct. Except for "Save As" - if you want to read an existing file, you should use  a file chooser with GTK_FILE_CHOOSER_ACTION_OPEN, not GTK_FILE_CHOOSER_ACTION_SAVE_AS. </div></div></div>