Quote: "GetDocumentsPath() Return the internal device path"
when
broadcast to my phone, it returns "/storage/emulated/0" which
is the phone's root path.
when
exporting the following, i receive "Error: Failed to open..." with "may not exist or this app doesn't have permission to access
s ... it at line 23" (3 sss's...?)
// Project: GetDocPath
// Created: 2019-11-18
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "GetDocPath" )
SetWindowSize( 1080, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1080, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
path$ = GetDocumentsPath()
FolderID = OpenRawFolder(path$)
NumFiles = GetRawFolderNumFiles(FolderID)
FileNames$ as String []
for x = 0 to NumFiles -1
FileNames$.Insert ( GetRawFolderFileName( FolderID, x) )
next x
CloseRawFolder(FolderID)
do
Print( path$ + " has " + STR(NumFiles) + " File(s) inside.")
Current = 0
for x = 0 to NumFiles -1
Print(FileNames$[x])
Inc Current
if MOD(Current,15) = 0
Sync()
Sleep(1000)
endif
next x
Sync()
loop
line 23:
FolderID = OpenRawFolder(path$)
so, it defines path$ 2 lines above**
IE: path$ = GetDocumentsPath()
...but can't open it.
**since confirmed with the following after line 21:
print (path$)
sync()
sleep(3000)
otherwise, the code runs fine using the
root path when
broadcast.
i know this isn't about the SD card but it may be refusing existence of the SD card due to a "permissions" thing (that i see no "tick" for in export)?