Android Question CameraexClass Error

MarcoRome

Expert
Licensed User
Longtime User
I use CameraExClass and i have a error, random in same time yes in another time no.

This is code:
B4X:
Sub Camera1_PictureTaken (data() As Byte)
    'setto data e ora nel formato desiderato
    DateTime.DateFormat = "yyyyMMdd"
    Dim now As Long = DateTime.now
    ' Nome dell'immagine
    filename  = now &".jpg"
    dirmia = File.DirRootExternal
    dirmia = dirmia & "/Paparazzi/"
    datatelecamera = data
    lista_foto.Add(filename)
    camEx.StartPreview 'restart preview
          
End Sub


The error is :

cameraexclass_savepicturetofile (java line: 588)
java.io.FileNotFoundException: /: open failed: EISDIR (Is a directory)
at libcore.io.IoBridge.open(IoBridge.java:409)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:370)
at com.devil.paparazzi.cameraexclass._savepicturetofile(cameraexclass.java:588)
at com.devil.paparazzi.act_photo._btnok_click(act_photo.java:433)
at com.devil.paparazzi.act_photo._tempo_salva_tick(act_photo.java:628)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5756)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: EISDIR (Is a directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:393)
... 18 more

upload_2016-11-5_20-19-11.png


Any idea about this error "java.io.FileNotFoundException: /: open failed: EISDIR (Is a directory)" ???

Thank you
Marco
 

Cableguy

Expert
Licensed User
Longtime User
I think the problem is :

dirmia = dirmia & "/Paparazzi/"

one of the back-slashes is not needed, I just don't know which... I think its the first one...
but I could be completely off!
 
Upvote 0
Top