wonder Expert Licensed User Longtime User May 19, 2016 #1 Hello hello! Why isn't "skull.obj" being listed? Code: B4X: For Each entry As String In File.ListFiles(File.DirApp) Log(entry) Next If File.Exists(File.DirApp, "skull.obj") Then Log("The file does exist!") Output: B4X: 'Program started. 'arena.jar 'The file does exist! PS: I know the read-only limitations of using DirApp under Windows. That's not a problem for me, I just want to read the file. Last edited: May 19, 2016
Hello hello! Why isn't "skull.obj" being listed? Code: B4X: For Each entry As String In File.ListFiles(File.DirApp) Log(entry) Next If File.Exists(File.DirApp, "skull.obj") Then Log("The file does exist!") Output: B4X: 'Program started. 'arena.jar 'The file does exist! PS: I know the read-only limitations of using DirApp under Windows. That's not a problem for me, I just want to read the file.
DonManfred Expert Licensed User Longtime User May 19, 2016 #2 where is the skull.obj located? Upvote 0
wonder Expert Licensed User Longtime User May 19, 2016 #3 In the same folder as the .jar file. B4X: If File.Exists(File.DirApp, "skull.obj") Then Log("The file does exist!") As you can see, File.Exists "detects" the file, but File.ListFiles does not... Upvote 0
In the same folder as the .jar file. B4X: If File.Exists(File.DirApp, "skull.obj") Then Log("The file does exist!") As you can see, File.Exists "detects" the file, but File.ListFiles does not...
DonManfred Expert Licensed User Longtime User May 19, 2016 #4 have you seen this? https://www.b4x.com/android/forum/t...not-jar-directory-in-linux.40138/#post-239474 Upvote 0
have you seen this? https://www.b4x.com/android/forum/t...not-jar-directory-in-linux.40138/#post-239474
wonder Expert Licensed User Longtime User May 19, 2016 #5 Erel said: In most cases it will be the jar folder as the user double clicks on the jar. However if you run it from the command line and you run it from a different folder then it will be a different folder. It should behave this way on all OSs. Click to expand... The behavior is the same from either double-click or command line. Can you reproduce it? You can use a dummy obj file. Last edited: May 19, 2016 Upvote 0
Erel said: In most cases it will be the jar folder as the user double clicks on the jar. However if you run it from the command line and you run it from a different folder then it will be a different folder. It should behave this way on all OSs. Click to expand... The behavior is the same from either double-click or command line. Can you reproduce it? You can use a dummy obj file.
Erel B4X founder Staff member Licensed User Longtime User May 19, 2016 #6 What happens when you try to open the file? Upvote 0
wonder Expert Licensed User Longtime User May 19, 2016 #7 The file opens without problems. It's just not being listed in ListFiles. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User May 19, 2016 #8 I'm unable to reproduce it here. Upvote 0
wonder Expert Licensed User Longtime User May 19, 2016 #9 I'm using an old version (3.50) of B4J on this PC. As this isn't my main computer I haven't bothered to update in a while. I'll report back after updating. Upvote 0
I'm using an old version (3.50) of B4J on this PC. As this isn't my main computer I haven't bothered to update in a while. I'll report back after updating.
wonder Expert Licensed User Longtime User May 19, 2016 #10 I'm not able to update B4J right now, but changing "For Each..." to "For i = 0..." resolved the problem. B4X: For i = 0 To (files.Size - 1) Log(files.Get(i)) Next Output: B4X: Program started. 'arena.jar 'bin 'ObfuscatorMap.txt 'skull.obj 'src Upvote 0
I'm not able to update B4J right now, but changing "For Each..." to "For i = 0..." resolved the problem. B4X: For i = 0 To (files.Size - 1) Log(files.Get(i)) Next Output: B4X: Program started. 'arena.jar 'bin 'ObfuscatorMap.txt 'skull.obj 'src