Android Question File.Exists Issue

David Hawkins

Active Member
Licensed User
Longtime User
Hi

I appear to be getting a strange result with file.exists. If the file exists then all is OK but if the file does not exist it is created by the file.exists function. My question is, should that happen.

I have checked and double checked to make sure that the case sensitivity is correct but the issue is still there.

Regards

David
 
Hi guys thank you for your fast response code is below

Code: Copy
    If File.Exists(File.DirRootExternal & "/RWW/", DownloadedDBname) = True Then
        File.Copy(File.DirRootExternal & "/RWW/", DownloadedDBname, File.DirRootExternal & "/RWW/", Main.DatabaseName)
        File.Copy(File.DirRootExternal & "/RWW/", DownloadedDBname.ToUpperCase, File.DirRootExternal & "/RWW/", "BACKUP.DB")
        File.Delete(File.DirRootExternal & "/RWW/", DownloadedDBname)
    End If

Regards

David
 
Upvote 0
Knock, knock ? Could it be because the path is artificially created and not created using File.Combine ?
 
Upvote 0
Code: Copy
    If File.Exists(File.DirRootExternal & "/RWW/", DownloadedDBname) = True Then
        File.Copy(File.DirRootExternal & "/RWW/", DownloadedDBname, File.DirRootExternal & "/RWW/", Main.DatabaseName)
        File.Copy(File.DirRootExternal & "/RWW/", DownloadedDBname.ToUpperCase, File.DirRootExternal & "/RWW/", "BACKUP.DB")
        File.Delete(File.DirRootExternal & "/RWW/", DownloadedDBname)
    End If



This code definitely does not create the file.

It is created elsewhere, such as NJDude wrote, or the file was previously created and not deleted. When you uninstall an app, files in the DirRootExternal are not automatically deleted.
 
Upvote 0
Back
Top