ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
512 stars 580 forks source link

FileSystem: need support for Apps root directory (parent of /files) #339

Open hschindler opened 3 years ago

hschindler commented 3 years ago

Feature Request

Plugin

Description

I need access to the apps root directory. Actually the DATA-directory give access to '/data/user/0/app-id/files. I need access to the parent directory of files: '/data/user/0/app-id/'. Because my sqlite database is stored under '/data/user/0/app-id/databases/sqlite.db'. And I would like to export this db. The cordova-plugin-file uses the code 'context.getFilesDir().getParentFile()' to access this directory.

Platform(s)

Preferred Solution

The cordova-plugin-file uses the code 'context.getFilesDir().getParentFile()' to access this directory. Add a new enum value 'DATA_ROOT' or change existing 'DATA' to 'DATA_FILES' and use 'DATA' for root access.

Alternatives

-

Additional Context

-

Galileon-venta commented 1 year ago

See: https://capacitorjs.com/docs/apis/filesystem#understanding-directories-and-files the Filesystem API supports using full file:// paths, or reading content:// files on Android which should start at ROOT Level.