shmu356
September 27, 2023, 7:26pm
16
i tried to delete it, but it seems not to work:
it should have deleted the file after writing it in label5 but it doesn't,
i can see the file have the correct path, but it still do not delete it, and the number of files in this directory getting higher then 1.
Taifun
September 27, 2023, 8:07pm
17
did you set the file scope to App ?
for the File.Delete method try a relative path, which start wth /Pictures...
Taifun
shmu356
September 27, 2023, 8:30pm
18
as you can see in the second image, it give the correct path:
shmu356:
but still do not delete.
Taifun
September 27, 2023, 8:37pm
19
I can see that you are using an absolute path...
The suggestion was
Also what about
Taifun
shmu356
September 27, 2023, 8:54pm
20
i will try the relative path.
the file.delete have only file name, not a scope, i added the scope as the absolute path
shmu356:
Anke
September 27, 2023, 8:55pm
21
As I've already showon in post #12:
If the FileScope = App you must set the subfolder and the fileName:
/Pictures/_app_inventor_image_picker/<fileName>
The File component does not use an absolute or full path .
1 Like
shmu356
September 27, 2023, 8:56pm
22
cool, thanks i try it now, i wished it was written in the documentation.
Anke
September 27, 2023, 8:58pm
23
This is not a relative path, but the subfolder of the ASD and the fileName.
If you want to use a relative path you must set FileScope = Legacy.
See also here: Some basics on Android storage system
Anke
September 27, 2023, 9:01pm
24
Btw, I also showed this in post #12:
shmu356
September 27, 2023, 9:01pm
25
yes i have read it already, but i do not know what components need what.
Anke
September 27, 2023, 9:02pm
26
Rebuild my blocks and try ...
shmu356
September 27, 2023, 9:11pm
28
@Anke @Taifun thanks very much it worked.
1 Like
Taifun
September 27, 2023, 9:13pm
29
In this case relative means relative to the ASD folder
Taifun
Anke
September 27, 2023, 9:33pm
30
Yes, I understand what you meant, but that would then require another definition in addition to
absolutive path
full path and
relative path
which could probably overwhelm or confuse most people.
Anke
September 27, 2023, 9:48pm
32
TIMAI2:
relative ASD path
This doesn't mean relative to the root dir of the external storage, but relative to the ASD.
Relative path basically means relative to the root dir of the external storage (/storage/emulated/0/
).
Anke
September 27, 2023, 9:51pm
34
Yes, we understand that, but do the users also?
TIMAI2
September 27, 2023, 10:13pm
35
I guess the problems arise when filescope is not set to App....
The relative path is the path AFTER whatever the filescope sets as the endpoint.....