Giter Club home page Giter Club logo

Comments (9)

br0kej avatar br0kej commented on September 27, 2024 2

It's not spam! All of these are valid. I'll look to fix the new one too!

from bin2ml.

cielonet avatar cielonet commented on September 27, 2024 1

Hey for the most part your changes worked well. I did find another little one nothing major. Otherwise thank you for the fixes...

bin2ml extract --mode cfg --fpath ../binary --output-dir thisfilefolderdoesnotexists

Unable to create file!: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)```

from bin2ml.

cielonet avatar cielonet commented on September 27, 2024 1

Sorry I feel like I'm spamming now :-( --- I tried using dedup this morning and even with valid expected data I was getting an error msg.

# using esil file
root@ae6a62491516:/app# touch out.json
███████████████████████████████████████████ 1/1
root@ae6a62491516:/app# bin2ml dedup esil --filename file_cfg-efs.json --output-path out.json 
thread 'main' panicked at src/dedup.rs:282:45:
Failed to create writer: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

# wrong type of json file
root@ae6a62491516:/app# bin2ml dedup esil --filename file_cfg.json --output-path out.json 
███████████████████████████████████████████ 1/1
thread 'main' panicked at src/dedup.rs:75:14:
Unable to load function data from file_cfg.json: Error("invalid type: sequence, expected a map", line: 1, column: 0)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)
root@ae6a62491516:/app# ls
file_cfg-efs.json  file_cfg.json  out.json

# using original binary file gives me no errors
root@ae6a62491516:/app# bin2ml dedup esil --filename file --output-path .

However even with no errors nothing is outputted.

from bin2ml.

br0kej avatar br0kej commented on September 27, 2024

Thank you again for the great feedback @cielonet. I will add some checks to the CLI 👍🏼

from bin2ml.

br0kej avatar br0kej commented on September 27, 2024

@cielonet , I have addd some initial validation to the CLI in main. If you have a mo, could you give it a try?

from bin2ml.

br0kej avatar br0kej commented on September 27, 2024

Hey for the most part your changes worked well. I did find another little one nothing major. Otherwise thank you for the fixes...

bin2ml extract --mode cfg --fpath ../binary --output-dir thisfilefolderdoesnotexists

Unable to create file!: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)```

I think this behaviour is correct. I didn't want to create repos that could be typos etc automatically and instead assume the directory is created beforehand. Does that make sense for your use case?

from bin2ml.

cielonet avatar cielonet commented on September 27, 2024

Hey for the most part your changes worked well. I did find another little one nothing major. Otherwise thank you for the fixes...
bin2ml extract --mode cfg --fpath ../binary --output-dir thisfilefolderdoesnotexists

Unable to create file!: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)```

I think this behaviour is correct. I didn't want to create repos that could be typos etc automatically and instead assume the directory is created beforehand. Does that make sense for your use case?

I am no expert in rust. Far from it, but I believe there is a way to catch these types of errors more elegantly so that core dumped isn't outputed using match.

match file_result {
        Ok(_) => {
            println!("File created successfully!");
            Ok(())
        }
        Err(err) => {
            if err.kind() == io::ErrorKind::NotFound {
                Err(io::Error::new(
                    io::ErrorKind::NotFound,
                    "The specified directory does not exist.",
                ))
            } else {
                Err(err)

This is just the QA guy in me :-). Thank you for looking over it.

from bin2ml.

br0kej avatar br0kej commented on September 27, 2024

@cielonet, I think I've fixed all of these on main. Could you check them out?

from bin2ml.

br0kej avatar br0kej commented on September 27, 2024

Assuming everything is all good! 👍🏼

from bin2ml.

Related Issues (4)

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.