Giter VIP home page Giter VIP logo

Comments (3)

natevw avatar natevw commented on July 26, 2024

So I ran this through lldb and discovered that the code is on some path that involves DADiskCreateFromBSDName which was unexpected since this isn't a disk image. That clue led me to BlockDevice code which recognizes a match when BlockDevice::IsFileHDD is true.

Turns out that this file has a size which happens to be an exact multiple of SECTOR_SIZE (512) and so rather than being treated as a SuperCardPro input it got handed to the BlockDevice class instead.

I was able to workaround this by appending an extra byte at the end of the file:

printf '\x00' >> test.scp

Not sure if this would still be an issue in the current version if it tries the SuperCardPro before the other driver, but it certainly seems to give the block device driver first dibs in the last macOS build that's available.

from samdisk.

simonowen avatar simonowen commented on July 26, 2024

Thanks for reporting this, and your analysis of the problem.

It all stems from SAMdisk's attempt to work out the type of arguments being passed on the command-line. Once it's decided (perhaps incorrectly) it goes all in on that assumed type, with no way to steer it back in the right direction -- that can lead to some confusing error messages. I think false-positives in IsFileHDD has become more of an issue over time because MAX_IMAGE_SIZE been increased from perhaps only 4MiB in early versions to the current 256MiB value, needed to accept multi-revolution flux images.

As a short-term fix I'd recommend having IsFileHDD always return false. I'll make a start on moving the other commands away from the argument detection where possible.

from samdisk.

natevw avatar natevw commented on July 26, 2024

Ah, didn't realize the code published here would still compile on macOS.

A nice feature long-term would be letting us specify the input/output types explicitly instead of from the file and/or its name.

from samdisk.

Related Issues (12)

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.