B4J Question Check if file exists on local hard drive

le_toubib

Active Member
Licensed User
Longtime User
Hi all
Sorry for the noob question..
I kept searching the forum over night but couldn't find it..
The following code doesn't work :
B4X:
If file.Exists("D:\Folder","\filename.txt") then
Log("file found")
End if

How to type the correct path?
 

stevel05

Expert
Licensed User
Longtime User
You don't need the extra separator, assuming D:\Folder\filename.txt is what you are after then this should work.
B4X:
If file.Exists("D:\Folder","filename.txt") then
Log("file found")
End if
 
Upvote 0
Top