Android Question file.size sometimes = 0

andredamen

Active Member
Licensed User
Longtime User
I want to know the filesize of imagefiles I import. Sometimes the file.size says 0. But in my windows explorer I see the size of the imagefile is 2.750 kb.

How is that possible and what an I do?

Code: Copy
Private Sub IsImageFile (Name As String) As Boolean
    Dim n As String = Name.ToLowerCase
    Log("1 ---------------------------")
    Dim dummyfs As Int = File.Size(Main.DirRouteMap, Name)
    Log("filesize :  " & dummyfs)
    dummyfs=dummyfs/1024
    Log(Name)
    Log(" in kb : "& dummyfs)
    If dummyfs > 1500 Then 
        Log(">1500")
        Return False
    End If
    
    If n.EndsWith (".jpg") Or n.EndsWith (".png") Or n.EndsWith (".gif") Or n.EndsWith (".bmp") Then
        Return True
    Else
        Return False
    End If
    
End Sub

[\code]
 
Back
Top