B4i Code Snippet File.Exists on Special folder - Star-Dust    
Jul 30, 2022   
(4 reactions)The need arose within a library to know if there was a Font in the Assets folder.
I didn't know if the developer had uploaded the font to the App, but if he didn't, the library would crash.
How to do? This was the solution
Dim no As NativeObject
Dim SpecialFolder As String = no.Initialize("NSBundle").RunMethod("mainBundle", Null).RunMethod("bundlePath", Null).AsString
If File.Exists(SpecialFolder,FontFileName) Then
'...'
End If...
B4J Tutorial [BANano] Checking File Existence : (Async Fetch - BANanoFetch Inside BANanoPromise) - Mashiane    
Oct 18, 2023   
(1 reaction)Hi
This code is based on a response I got about something else I needed about files, fetch & promise.
Anyway.. The code below will check if a file exists and return true / false. I need the file check to trap & report an error if the file does not exist.
private Sub FileExist(fn... - checking a file on assets directory.
Dim fe As Boolean = BANano.Await(FileExist("./assets/dbFile.sql"))
Have Fun....
B4J Code Snippet File.Exists on DirAssets - Star-Dust    
Feb 21, 2022   
(2 reactions)The need arose within a library to know if there was a Font in the DirAssets.
I didn't know if the developer had uploaded the font to the App, but if he didn't, the library would crash.
How to do? This was the solution
Private Sub FontExist(FileName As String) As Boolean
'If File.Exists(File.DirAssets, "ftypes") Then Return True
Dim r As Reflector
r.Target = Me...("getResourceAsStream", "/Files/" & FileName, "java.lang.String")
If In...
B4i Question [Solved] Attempted to insert nil object - File.Exists - hatzisn    
Apr 13, 2019.Exists(File.DirDocuments & Folder, "") = False Then
' File.MakeDir... and call it with this code:
If File.Exists(rp.GetSafeDirDefaultExternal("Guide"...
link: I just figured out that working hours must have limits because if you go way too far with it, mistak...
link: The debugger uses ~2 different execution pipelines. In some edge cases the behavior between the diff...
link: Never mind I will try to create a new project and send it here....
Wish Check if a file exists in a layout. - Filippo    
Oct 30, 2023   
(1 reaction)Hi,
I wish that the compile checks if all files in the layout filelist are also present in the IDE... a layout, but in the IDE the file was deleted.
Thanks already in advance...
link:
Using B4XPages (Shared folder) for Assets solves this to some extent
In my case, that wouldn't...
link:
Usually happens if you copy layout file from one platform example B4A to the other example B4i and...
link: point to it)
Usually happens if you copy layout file from one platform example B4A to the other...
B4i Question File.Exists returns False if the file name has a space - Alex_197    
Jul 15, 2022Hi all.
If I try to check if the file exists and the filename has a space like "My Logo.jpg" File.Exists returns False even though the file is really exists. I tried to replace space with %20 - didn't work either.
...
link: Did you try with File.Combine ?...
B4J Question File.Exists("","") return true using JRE 26 - xulihang (first post)    
Sep 16, 2026   
(3 reactions)This change is starting from JDK 25: https://inside.java/2025/11/03/quality-heads-up/...
link: I created a sub and replace all the File.Exists with this Sub.
Public Sub Exists(dir As String...
link: WorkFolderTextField.Text <> "" Then
If File.Exists(WorkFolderTextField.Text...
link: serverShell as Shell
If File.Exists(WorkFolderTextField.Text,"") Then
serverShell...
B4J Question File.exists() - wrong output? - ilan    
Jul 11, 2021hi
i am running a check if a file exists in the file dirassests folder but I am getting FALSE even though the file exists!
116183
Waiting for debugger to connect...
Program started.
file exists...
link:
From the help:
Returns true if the specified FileName exists in the specified Dir.
Note...
link: ok found the answer: https://www.b4x.com/android/forum/threads/load-image-or-file-from-jar.38215...
link:
Then I tested your project with older B4J versions, even with B4J version 7.51 and it always return...
B4A Question File.Exists in Windows - drponciano (first post)    
Mar 5, 2026I'm an idiot! You are right! Thanks. Two heads think better than one always!...
link:
1.Are you sure your app is running on Android?
2.Why is the path \BASIC4~1\ instead of \Basic4Mac\...
link: Furthermore, the file that appears to exist is "ANGEL_MERINO_GUZMAN_1_0.PRM.PDF"...
link: you mentioned does not exists in Android.
Remember that you are asking a ANDROID-Question here. Or do...
B4J Question [solved] File Exist on Windows - udg    
Feb 18, 2020 right and wrong path for File.Exist, but it seems to work ok in any case.
Here it is my testing... True altough a forwarding slash is used
Log("Image exists : " & File.Exists(DataFolder...
link: If you want to know the correct separator for the os system, use
log(GetSystemProperty("file...
link: File.Exists(DataFolder&"/images", "test.png"))
udg...
link: .
it just seems to merge both with (back)slash correction.
the only issue I got so far with file...
Page: 1  
2  
3  
4  
5