Spanish File.OpenInput ENOENT (No such file or directory) - angel_    
Nov 25, 2020Tengo varios errores en Crashlytics relacionados con ENOENT (No such file or directory) en anywheresoftware.b4a.objects.streams.File.OpenInput, sucede con diferentes versiones de Android (7.1.1, 9 y...
link: He eliminado un Sleep(0) antes de la apertura del archivo que creo que me daba problemas, os iré inf...
link: lineas de la 4 a la 7 con un
if file.exist then
...
.Puedes poner el codigo donde copias o creas ese...
link: No, lo puse como ejemplo es: .ufr...
B4A Code Snippet [B4X] Bytes To File - Erel    
May 24, 2020   
(19 reactions)This code is no longer needed. Use File.WriteBytes / ReadBytes.
Write an array of bytes to a file and read a file into an array of bytes.
Sub BytesToFile (Dir As String, FileName As String, Data() As Byte)
Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
End Sub
Sub FileToBytes (Dir As String, FileName As String) As Byte()
Return Bit.InputStreamToBytes(File.OpenInput(Dir, FileName))
End Sub
Note that you can convert...
B4A Code Snippet SaveAs - Let the user select a target folder + list of other related methods - Erel    
Nov 1, 2024   
(46 reactions) for the example.
Wait For (SaveAs(File.OpenInput(File.DirInternal, "test.txt"...-files.132731/#post-838166
List of classes or libraries that can be used to access secondary storages:
ContentChooser (Phone libray) - allows the user to select a resource or file using external... the simpler version of ExternalStorage. Allows the user to choose the place where the file will be saved...
File.Copy2(Source, out)
out.Close
Return True
End If
Return False...
B4A Code Snippet Get the path to media files returned from ContentChooser - Erel    
Jul 24, 2022   
(10 reactions) then you can use File.OpenInput to open an input stream. You can also use it together with File.Copy2...It is a mistake to try to get a file path from the returned resource. It will not work in most cases, and even if you will be able to get the path, you will not be able to access it.
You can use File.OpenInput to access the remote resource.
Correct solution: TextEditor - Save and load external files
SubName: GetPathFromContentResult
Description: Content providers such as the media gallery...
B4A Tutorial [java] Loading files from a library - Erel    
Mar 11, 2014   
(2 reactions)The correct way to load files from a library is with anywheresoftware.b4a.objects.streams.File.OpenInput.
anywheresoftware.b4a.objects.streams.File.OpenInput deals correctly with standard files, assets files and virtual assets file (new to v3.50).
Starting from v3.50 the rapid debugger uses a virtual assets folder. This allows the debugger to only redeploy updated files. This means that if you try to directly load a file from the assets file then it will fail.
Calling File.OpenInput...
B4A Question anywheresoftware.b4a.objects.streams.File.OpenInput - Star-Dust (first post)    
Oct 22, 2017No. Assuming that the main activity will start before other activities is a mistake. This is exactly...
link: Can it be a problem related to the device?
No. Assuming that the main activity will start before oth...
link: model, because for some reason I never knew I was deleting continuances and files I saved in...
link: It's funny what the users can do.
I tried to reproduce the same scenario, unfortunately without ...
B4A Library JTidy library - Convert HTML pages to XML - Erel    
Apr 8, 2018   
(10 reactions)
'parse the Html page and create a new xml document.
tid.Parse(File.OpenInput(File.DirAssets, "index.html"), File.DirRootExternal, "1.xml")
sax.Initialize
sax.Parse(File.OpenInput(File.DirRootExternal, "1.xml"), "sax")
End Sub
Tips: By default...
B4A Code Snippet Add image to Gallery Android 5 - 10+ - Erel    
Oct 12, 2026   
(18 reactions)(File.OpenInput(File.DirAssets, "logo.png"), "logo.png", "image/png"...("getContentResolver", Null).RunMethod("openOutputStream", Array(imageuri))
File...
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "Pictures/" & TargetName, False)
File.Copy2(In, out)
out.Close
Dim FilePath As String = File.Combine(File.DirRootExternal, "Pictures/" & TargetName...
B4J Library [server] FirebaseServer - backend verification for signed in users - Erel    
Feb 14, 2023   
(16 reactions).Initialize("fs", File.OpenInput(File.DirAssets, "B4A-Test1-1878011f6afe.json"....com/docs/server/setup#add_firebase_to_your_app
Copy the json file to the Files tab.
Simple example...)
End If
End Sub
Library: www.b4x.com/b4j/files/jFirebaseServer.zip...
B4J Question Load Image or File from Jar - margret    
Feb 25, 2014 that will? Also, it would be nice to load a data file or list this way as well. Thanks for any help:
Private Sub LoadFileFromJar(FileName As String) As InputStream
'If fromAssets Then Return File.OpenInput(File.DirAssets, FileName)
If File.Exists(File.DirAssets, "ftypes") Then Return File.OpenInput(File.DirAssets, FileName)
Dim r As Reflector
r.Target = Me
r.Target = r.RunMethod...@Erel
You provided the code below for B4A, to load an image from the library jar file instead...
Page: 1  
2  
3  
4  
5  
6  
7