main._appstart (java line: 170)
java.lang.RuntimeException: java.io.FileNotFoundException: /tmp/6 (No such file or directory)
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1052)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:180)
at b4j.example.main._appstart(main.java:170)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.main(main.java:28)
Caused by: java.io.FileNotFoundException: /tmp/6 (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:244)
at b4j.example.httpjob._getstring2(httpjob.java:252)
at b4j.example.httpjob._getstring(httpjob.java:241)
at b4j.example.main$ResumableSub_getNext.resume(main.java:3177)
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1050)
... 11 more
It seems that the getstring I'm doing on the HttpJob causes a file not found error in a temporary directory? Can anyone explain why this is happening?
I've found the source of the problem. I had this in my code:
B4X:
JobDoc.Download("https://xxxx")
Sleep(7000)
Wait For (JobDoc) JobDone(JobDoc As HttpJob)
This seems to work fine on Windows, but on Linux the temporary file created by the http download is deleted after less than 7 seconds, which results in a file not found error.
I've found the source of the problem. I had this in my code:
B4X:
JobDoc.Download("https://xxxx")
Sleep(7000)
Wait For (JobDoc) JobDone(JobDoc As HttpJob)
This seems to work fine on Windows, but on Linux the temporary file created by the http download is deleted after less than 7 seconds, which results in a file not found error.
I've found the source of the problem. I had this in my code:
B4X:
JobDoc.Download("https://xxxx")
Sleep(7000)
Wait For (JobDoc) JobDone(JobDoc As HttpJob)
This seems to work fine on Windows, but on Linux the temporary file created by the http download is deleted after less than 7 seconds, which results in a file not found error.
Remember that that a call to Sleep or Wait For in a resumable sub causes the code flow to return to the parent. Example: Sub Button1_Click Sum(1, 2) Log("after sum") End Sub Sub Sum(a As Int, b As Int) Sleep(100) 'this will cause the code flow to return to the parent Log(a + b) End Sub...