Recent

Author Topic: Any RequestOpenDirectory and write files Example?  (Read 508 times)

eolandro

  • New Member
  • *
  • Posts: 18
Any RequestOpenDirectory and write files Example?
« on: January 16, 2025, 06:56:44 am »
Hi!

I wanna write several binary files in a folder (00.bin,01.bin,02.bin). I know RequestOpenDirectory is need for get the treeUri  in my ActivityResult, but, how i can join each namefile to treeUri?

Code: Pascal  [Select][+][-]
  1. if requestCode = 333 then  //open directory tree
  2. begin
  3.       for i := 0 to 3 do
  4.       begin
  5.          fname := format('%.2d',i);
  6.          fname := fname + '.bin';
  7.          // this not exist
  8.          newuri = JoinFilenameToUri(treeUri,fname);
  9.          Self.SaveBytesToUri(newuri,buffer);
  10.       end;              
  11. end;                                          
  12.  
« Last Edit: January 16, 2025, 08:51:32 am by eolandro »

Thaddy

  • Hero Member
  • *****
  • Posts: 16520
  • Kallstadt seems a good place to evict Trump to.
Re: Any RequestOpenDirectory and write files Example?
« Reply #1 on: January 16, 2025, 07:14:51 am »
Does not make any sense at all.
I guess, but that is really guessing this is about Android?

But I am sure they don't want the Trumps back...

eolandro

  • New Member
  • *
  • Posts: 18
Re: Any RequestOpenDirectory and write files Example?
« Reply #2 on: January 16, 2025, 08:50:30 am »
Yes is about android... Just maybe my English sucks!

Here I go again.

I wanna use a directory in the public storage for outputs several binary files.

In AppPublicFoldersAccessDemo1 uses Self.RequestOpenDirectory to get a directory and read the content.

I'm looking for code snipped or example for writing binary files in a directory selected with Self.RequestOpenDirectory

 

TinyPortal © 2005-2018