Android Question SMB Writeline

Discussion in 'Android Questions' started by ElliotHC, Jul 30, 2019.

  1. ElliotHC

    ElliotHC Active Member Licensed User

    I have a file in a shared folder on a laptop on the network.

    I am doing the following:

    Code:
    Dim SMB1 As SMB
    SMB1.SetCredentials(
    "User","123456789","")
    SMB1.Initialize(
    "SMB1")
    I've set up the user on the laptop and given access to the shared folder.

    I can't see any examples where I can writeline to the txt file within the folder..

    Anyone able to help?

    In the Java App I'm doing this:

    Code:
    Writer.Initialize(File.OpenOutput("C:\Shared\"Filename.txt", True))
     Writer.Write("TEXT")' or writeline for CR
     
  2. DonManfred

    DonManfred Expert Licensed User

    The Laptop is running which OperatingSystem?
    The Laptop is using WHICH SMS Protocoll-Version? SMB1/2/3
     
  3. ElliotHC

    ElliotHC Active Member Licensed User

    Laptop is running windows 7

    SMS?

    I'm using the SMB library on the Android device to try read and modify a text file on the Laptop's shared folder.

    Both are on the local Wi-Fi network
     
  4. DonManfred

    DonManfred Expert Licensed User

  5. ElliotHC

    ElliotHC Active Member Licensed User

    Thanks, I've checked that library but it's not finding it..

    Code:
    Dim SMB2 as SMB2?
     
  6. DonManfred

    DonManfred Expert Licensed User

    Have you checked the jciffs library in the library tab?
     
  7. ElliotHC

    ElliotHC Active Member Licensed User

  8. ElliotHC

    ElliotHC Active Member Licensed User

  9. DonManfred

    DonManfred Expert Licensed User

    the object to use is SMBClient. Change SMB2 to SMBClient.

    Is the example outdated? Hmmm... i´ll check later
     
  10. ElliotHC

    ElliotHC Active Member Licensed User

    I've managed to install and run the example but it doesn't do anything with writing to files.

    I'm really struggling to try and work out how you go about getting it to use openOutputStream
     
  11. DonManfred

    DonManfred Expert Licensed User

    New Question? New thread.

    One thread should summarize one question.
     
  12. ElliotHC

    ElliotHC Active Member Licensed User

    It's still trying to achieve the objective of this thread, to append to a text file located in shared file on a windows laptop. I've installed the library, which is needed to be done, but I'm still to achieve the objective which is to append to the file.
     
  13. DonManfred

    DonManfred Expert Licensed User

    It is a question about the jcifns lib and how to work with it.
    Do not expect me to answer anything more in this thread
    Your question in #1 is about the SMB Library which only works with SMB1.
     
  14. ElliotHC

    ElliotHC Active Member Licensed User

    If I was trying to figure out how to do something and I came to a thread where someone asked how it was done, then found that after a single question the thread was closed. You'd be jumping from thread to thread trying to figure out how to do something. That seem absolutely ludicrous.

    I'm just trying to append to a text file using B4A, on a Windows 7 shared folder. In asking how it's done, you've kindly given me a link to a library and example.

    Unfortunately, that example doesn't give an example or explain how you use the openOutputStream command which I assume is what does it.

    I've spent the entire time since I started this thread trying to search through various threads and modify the example to do what I'm trying to achieve, but still I don't know how.

    If I start another thread, it will be titled "SMB Writeline" and will contain exactly the same question. Surely it's better for me to try and ask the relevant questions here to achieve this objective?

    Q. How do I append to a text file using B4A on a shared folder on a windows laptop?
    A. Using the jciffs library.

    Close Thread

    Very unhelpful!
     
  15. DonManfred

    DonManfred Expert Licensed User

    OK, understand.

    Good luck with your Issue(s).
     
  16. ElliotHC

    ElliotHC Active Member Licensed User

    I should just clarify that my question wasn't about the SMB1 library, it was how to do it generally using SMB. I had tried to use it and it wasn't working. I also included code from B4J that I was using, but my post wasn't about B4J either.
     
  17. ElliotHC

    ElliotHC Active Member Licensed User

    Thank you for your help up to now, it is much appreciated.
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    You will need to download the file, append the line and upload it.
    Append:
    Code:
    Dim tw As TextWriter
    tw.Initialize(
    File.OpenOutput(..., ..., True))
    tw.WriteLine(
    "aaa")
    tw.Close
     
    ElliotHC likes this.
  19. ElliotHC

    ElliotHC Active Member Licensed User

    Thank you Erel, I'd pretty much tried everything. I'll give that a go.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice