GithubHelp home page GithubHelp logo

Comments (7)

jefft0 avatar jefft0 commented on June 10, 2024

Hello @westice007 . I am able to reproduce your error with files/cp . For me, I see this error. But if I use files/ls, then it shows that the file was added by files/cp . What does files/ls show on your system?

from gomobile-ipfs.

westice007 avatar westice007 commented on June 10, 2024

@jefft0 Instead of using files/ls, I use files/stat to check file, files/ls should be used to check folders

from gomobile-ipfs.

jefft0 avatar jefft0 commented on June 10, 2024

@westice007 , thanks for the clarification. I mean to ask, even if files/cp shows an error, is the file created on your phone?

from gomobile-ipfs.

westice007 avatar westice007 commented on June 10, 2024

When I use files/cp, I get an error, but the file copy is successful, and then I can check the result with files/stat
this is my code:

func exeCpCmd(srcPath: String, mfsPath: String) -> String? {
    do {
        let res = try self.ipfs?.newRequest("files/cp")
            .with(argument: srcPath).with(argument: mfsPath)
            .send()
    } catch let error {
        print("this is bug: exeCpCmd cp: \(error) hashId:\(srcPath) mfsPath:\(mfsPath)")
    }
    
    var changedHash: String?

    do {
        var fileInfo : [String: Any]? = [String: Any]()
        fileInfo = try self.ipfs!.newRequest("files/stat")
        .with(argument: mfsPath)
        .sendToDict()
        changedHash = fileInfo?["Hash"] as? String
    } catch let error {
        //print("exeCpCmd cp: \(error) hashId:\(srcPath) mfsPath:\(mfsPath)")
        
    }
    return changedHash
}

from gomobile-ipfs.

jefft0 avatar jefft0 commented on June 10, 2024

Thank you for confirming. This is the same behavior for me. We have found the cause of the error. Because files/cp returns an empty response, the return value should be nil. This works in Java (Android), but there is a behavior in the Swift/Go binding code which prevents returning a nil result. We are working on resolving it.

from gomobile-ipfs.

jefft0 avatar jefft0 commented on June 10, 2024

Hello @westice007 . We merged pull request #135 into master which fixes this crash in the Swift code. Can you please check if it fixes your problem? Thanks.

from gomobile-ipfs.

jefft0 avatar jefft0 commented on June 10, 2024

As mentioned. We merged a fix. Closing this issue as resolved. If you still see the error, then please open another issue. Thank you.

from gomobile-ipfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.