← Back to team overview

ubuntu-phone team mailing list archive

Re: Accessing the user's files in a click app

 

Hi all,

Thanks for the many replies, all. It's a bit overwhelming, and I fear I may have missed something. I'm going to try to summarize; please correct my mistakes:

1) There's no way to do what I want to do right now.
2) The content hub may provide the capabilities I want in the future, but this may not look like file access. 3) There may be additional ways to access the file system in the far future.

As several of you have correctly surmised, this is for my epub reader Beru [1], which is currently limited to reading epubs stored in ~/.local/share/com.ubuntu.developer.rschroll.beru/, which isn't exactly convenient for the user to access. But I asked this in general, because I don't want an epub-specific solution. I want something that will work for anyone who's trying to build a viewer for Ubuntu Touch.

Let me try to clarify a few points:

Jamie Strandboge wrote:
your app would only get a copy of the file in the app-specific directory but no way to sync the file back out to its original location (in the future, we should/may also support passing a file descriptor instead of a full copy-- but this is an implementation detail that won't help your use case).

[...]
In short, your use case falls into the category of 'backup software' and backup software is not supported by the appstore at this time.


You're crediting me with too much ambition. I don't want to modify or keep a copy of the epub files, I just want to read them. The write access I want is to be able to download new epub files, but I'm less concerned about that (at the moment).

Marc Deslauriers wrote:
The first message in this thread sounds like he wants to access arbitrary directories in the user's home folder. His original post however seems to indicate he wants his ebook reader to be able to read and write ebooks into
arbitrary locations in the user's home directory.


I'd prefer arbitrary locations, to allow the user to choose where to save their files and to allow for run-time localization. But if we restrict it to a give sub-directory at compile time, that wouldn't be the worst thing in the world.

Perhaps I'm thinking too much about files because that's what I'm used to. What I really want to do is access content that the user already has on the device and add additional content for the user to take off the device. I had thought that's what the Content Hub was about, but...

Our application security model has each application owning its own data, and sharing it with other applications. In other words, the ebook reader should be storing its files in its own directory, and offering them to other applications via the content hub.


How does this work for content the user already has? The main point of Beru is to let the user read the epubs the user already owns. Can the user only copy the content over after they've chosen which reader to use? That seems backwards. Furthermore, what if I become evil (well, more evil than usual) and stop offering Beru's books to other apps? This locks users into using Beru (or forces them to wade through hidden directories to recover their content).

This approach seems completely counter-intuitive to me. Is the rationale behind it documented somewhere?

Michael Zanetti wrote:
On Friday 25 October 2013 08:13:20 Marc Deslauriers wrote:

‘5’
Oh, nice. What is the problem then why Robert's use cases don't work?


One problem is that there's not "epub_files" policy. But even if there was, it doesn't solve the general case for fpub files, gpub files, etc.

Michael Zanetti wrote:
Wouldn't it make sense to have such a policy group for the "Documents" folder? that would probably be just what Robert needs, no? Given that eBooks (which I think is Robert'main use case) are quite big (in terms of distribution) nowadays I could even imagine adding a ~/Books folder with appropriate capabilities could make sense. What do you think?

When I first submitted Beru, I asked for read and write access to ~/Books. This was denied. But again, this is a special-case solution to what seems to me to be a general problem.

Thanks for the answers,
Robert

[1] rschroll.github.io/beru/





Follow ups

References