I am trying to implement a database provider using LiteDb on my raspberry pi using UWP. It has an external hard drive attached and I would very much like to use it as a specific "Database" drive, to allow me to have a larger supported database size.
I am being passed a StorageFile
, which is then to be used as my Database file. One constructor on LiteDb uses a stream (System.IO.Stream
), is there anyway to convert the StorageFile
object into a stream (derived from System.IO.Stream
) in order to fulfill the new win10 security restrictions (requiring user permissions to access areas etc., preventing traditional File.Write/path based access to anything other than your application data directory).
Really am stuck, the option I have tried, which gives both read and write access to the StorageFile
is:
var stream = storageProvider.StorageLocaton.OpenAsync(FileAccessMode.ReadWrite);
Unfortunately, I cannot find any other methods which give both read/write access to the file as a stream.
Hopefully someone on here has a work around/solution.