B4A Library File handling library

HavasuPreditor

Member
Licensed User
Longtime User
Yes it is, and yes you'll need root to mount the drive.

--- Jem
Hello Jem,
Would you happen to have an example of code to Mount a drive. I Think a have a pretty good handle on CIFS.
But I not sure how to place it in code with your library.
thanks for any help, Carter
 

HotShoe

Well-Known Member
Licensed User
Longtime User
Very much like mounting an NFS system.

mount -t cifs //192.168.1.35/Sharename /mnt/share -o username=USERNAME,password=PASSWD

This would mount the share "Sharename" on this smb server at /mnt/share on your device, and supply the username and password. You can use the rootcmd in mlfiles to do this.

--- Jem
 

HavasuPreditor

Member
Licensed User
Longtime User
Hey Jem,
Thank you for the help.
I think I got what you are saying, but I'm not sure about the arguments Args, StdOut and StdErr.
this is what I have so far:
B4X:
Dim MountCmd As MLfiles
MountCmd.RootCmd("mount -t cifs //192.168.100.51/o$ /mnt/drive -o domain=Domain,username=User,password=Pass",?,?,?,False)

thanks again, Carter
 

HotShoe

Well-Known Member
Licensed User
Longtime User

Just add a couple stringbuilders something like:
B4X:
dim sb1, sb2 as stringbuilder

MountCmd.RootCmd("mount -t cifs //192.168.100.51/Users/carter /mnt/drive -o domain=Domain,username=User,password=Pass","",sb1,sb2,False)

the sb's will return any reply or error from the command. the args is not required since you are sending everything in the command string (which should work just fine). otherwise it would be the options for the mount command (everything after "mount").

--- Jem
 

HavasuPreditor

Member
Licensed User
Longtime User
Ah, now I get it!
I was thinking I needed to send something, funny how you can get stuck in a mind set.
I will give it a try.
thanks again for all the help, Carter
 

HotShoe

Well-Known Member
Licensed User
Longtime User
Version 1.50 is attached to the first post. It separates the files and SMB methods into 2 libraries.

--- Jem
 

HotShoe

Well-Known Member
Licensed User
Longtime User
This is just a bump to remind people that this library exists.

--- Jem
 

fanfalveto

Active Member
Licensed User
Longtime User
i´m trying to test the smbtst example,i add the library but says if i´m missing the library.
You know what happends?
thank you
 

HotShoe

Well-Known Member
Licensed User
Longtime User
You need to download the jcifs library from the link at the end of the first post and put it in your additional libraries directory.

--- Jem
 

fanfalveto

Active Member
Licensed User
Longtime User
B4X:
Parsing code.                          Error
Error parsing program.
Error description: Unknown type: mlsmb
Are you missing a library reference?
Occurred on line: 16
Dim sf As MLsmb
is for not insert the library,i know
bur the library is in
 

HotShoe

Well-Known Member
Licensed User
Longtime User
make sure that mlsmb is checked in the libraries tab and that mlsmb.jar and jcifs.jar is in your additional libraries directory. That's all it takes for b4a to find them.

--- Jem
 

dibesw

Active Member
Licensed User
Longtime User
make sure that mlsmb is checked in the libraries tab and that mlsmb.jar and jcifs.jar is in your additional libraries directory. That's all it takes for b4a to find them.

--- Jem
HI Hotshoe,
I have the same problem.
MLsmb tab is checked (v 1.50) but cannot see jcifs tab.
In the zip file of jcifs.zip there is only jcifs.jar but there isn't jcifs.xml
 

HotShoe

Well-Known Member
Licensed User
Longtime User
jcifs is required by the MLsmb library, It will not show up in the IDE. It should be copied to your Additional Libraries directory along with the MLsmb.jar and MLsmb.xml files.

--- Jem
 

HotShoe

Well-Known Member
Licensed User
Longtime User
I use it in several apps and can't reproduce this. The MLsmb library must be checked in the libraries tab, and MLsmb.jar, MLsmb.xml, and jcifs.jar must be in your additional libraries directory.

--- Jem
 

ericvanderhoeven

Member
Licensed User
Longtime User
Hi,

can I use this lib to copy an edited version of the build.prop to /system/?

I am having a bit of trouble doing this via code. The device is rooted as e.g. romtoolboxlite can be used to edit /system/build.prop manually and that saves just fine..

But if I use code like

busybox cp /mnt/sdcard/whatever.txt /system/build.prop

I get ''read only file system'' returned :-(

Thanks,

Eric
 

sanjibnanda

Active Member
Licensed User
Longtime User
I use it in several apps and can't reproduce this. The MLsmb library must be checked in the libraries tab, and MLsmb.jar, MLsmb.xml, and jcifs.jar must be in your additional libraries directory.

--- Jem
hello ,

same error here, i tried all sort of combinations , but the lib reference to MLsmb does not show up (though it is there in IDE Tab)

could you see into this?

regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…