<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body 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="🙁">🙁</span><br>
</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);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Matthias Clasen <mclasen@redhat.com><br>
<b>Sent:</b> November 21, 2019 4:11 PM<br>
<b>To:</b> Winnie Poon <winniepoon_home@hotmail.com><br>
<b>Cc:</b> Jorge García <jgarciao@gmail.com>; Jan Grulich <jgrulich@redhat.com>; Flatpak List <flatpak@lists.freedesktop.org><br>
<b>Subject:</b> Re: flatpak portal example on github</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, Nov 21, 2019 at 6:03 PM Winnie Poon <<a href="mailto:winniepoon_home@hotmail.com">winniepoon_home@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_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)">
Hi Jorge,</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'm using the libportal together with the portal test example.  I'm trying to understand how to open a file in my home folder inside the sandbox without using --filesystem=/home/user.  I tried the File Chooser on the UI and clicked Save As but that doens't
 seem to copy the original file content, but just write "test" to a file.   I couldn't find an example how open up a file to be accessible inside the sandbox.  Am i looking at the wrong place?</div>
</div>
</blockquote>
<div><br>
</div>
<div>You want to open an existing file for reading, or write something to a new file?</div>
<div><br>
</div>
<div>Using the portal for this purpose should be essentially identical to using a "traditional" file chooser from your toolkit.</div>
</div>
</div>
</div>
</div>
</body>
</html>