Hello AGKlers,
My idea was, that the user can copy some of its users own pictures into the media folder and I can search them and open them and show the user a tree-structure.
I have a problem, and it is very frustrating. I want to get the files I have in the media folder. My idea was, to "search" for them.
BUT! To use GetNextFolder I have to use SetFolder, but SetFolder creates a Folder in "AppData\Local\AGKApps\my program name" ... that is not, what I want!!! I want to read, not to write.
I am Using Windows 10 64 Bit.
I think, that there is a strange mixing between the Write-Folder and the Media-Folder from the program. I also don't understand, how I can change BACK! a folder. Because if I used once SetFolder (), I can't use SetFolder("") to navigate to my program App-Data-folder "root" again.
Global ListA as String[]
Global ListP as String[]
Global Folders
//List[0]=""
Function GetFolderStruct(dir$) // not recursive now
/*
-c:\media\
-c:\media\hallo\
-c:\media\hallo\path1\
-c:\media\hallo\path2\
-c:\media\mike\
-c:\media\mike\musel\
-c:\media\mike\musel\jeans\
Media
> hallo
> mike
..
hallo
> path1
..
> path2
..
..
mike
> musel
..
musel
> jeans
..
*/
//dir$=GetFolder()
if dir$ <> "." and dir$ <> ".."
SetFolder(dir$)
//ListA.insert(dir$)
first$=GetFirstFolder()
if first$<>""
ListA.insert(dir$+first$+"/")
if GetFolderCount()>1
For i = 2 to GetFolderCount()
ListA.insert(dir$+GetNextFolder()+"/")
//
Next
EndIf
EndIf
Endif
EndFunction
GetFolderStruct("/")
listP = ListA
lin = listP.length
For i=0 to lin
GetFolderStruct(listP[i])
Next
SetFolder("")
// Media-Folder
OTWF = OpenToWrite("Files_List.txt")
For i=0 to listA.length
WriteLine(OTWF,listA[i])
Next
CloseFile(OTWF)
It is not Android, it is Windows! My work arround was, to create a file-list of all my files with PureBasic, but that can't be the right way.
Why do I use "." and ".." because I thought, that there are the problem, because in my tests I got "media" and other folder names I did not entered before.
I realizied, that SetFolder will create them, no matter if I wanted them or not.
This would create another problem, if I had to copy all data from my program into the user folder, that would not be very user friendly. If the user has Steam installed on another drive than the users, I had to copy nearly the complete program.
How can I get a folder-tree of my assets in the media folder?
Or do I have to do it with another program like I did it before? If it is not possible, my question then would be, how do I get a file/folder-tree of all assets from the users-folder?
(I wanted to create a tool also for AppGameKit users, but if I can't get some file information from unknown files, it is impossible to do it in a userfriendly way)
Thanks for help.